From ccb398ac3a4db0e41b1463e5185cfa070198067a Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 24 Nov 2026 15:49:45 +0100 Subject: [PATCH 01/12] Replace generateapichanges with api and verifyapi targets Bump assembly-differ to 1.2.1. The old target ran the diff command and only wrote a markdown file, so it never failed. api writes the public API to api/, verifyapi fails when api/ differs from the Release build. Co-Authored-By: Claude Sonnet 5.5 --- build/scripts/CommandLine.fs | 6 +++-- build/scripts/Paths.fs | 1 - build/scripts/Targets.fs | 44 ++++++++++++++++-------------------- dotnet-tools.json | 2 +- 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/build/scripts/CommandLine.fs b/build/scripts/CommandLine.fs index 545f2b0a..1e154e34 100644 --- a/build/scripts/CommandLine.fs +++ b/build/scripts/CommandLine.fs @@ -16,7 +16,8 @@ type Arguments = | [] GeneratePackages | [] ValidatePackages | [] GenerateReleaseNotes - | [] GenerateApiChanges + | [] Api + | [] VerifyApi | [] Release | [] CreateReleaseOnGithub @@ -32,6 +33,8 @@ with | Clean -> "clean known output locations" | Build -> "Run build" | Test -> "Runs build then tests" + | Api -> "Builds Release and writes the public API to api/, run it after an intended API change" + | VerifyApi -> "Builds Release and fails when api/ does not match the public API" | Release -> "runs build, tests, and create and validates the packages shy of publishing them" | Publish -> "Runs the full release" @@ -43,7 +46,6 @@ with | GeneratePackages | ValidatePackages | GenerateReleaseNotes - | GenerateApiChanges | CreateReleaseOnGithub -> "Undocumented, dependent target" member this.Name = diff --git a/build/scripts/Paths.fs b/build/scripts/Paths.fs index 4d797c7a..f3f1d504 100644 --- a/build/scripts/Paths.fs +++ b/build/scripts/Paths.fs @@ -14,7 +14,6 @@ let SignKey = "069ca2728db333c1" let ValidateAssemblyName = false let IncludeGitHashInInformational = true -let GenerateApiChanges = false let Root = let mutable dir = DirectoryInfo(".") diff --git a/build/scripts/Targets.fs b/build/scripts/Targets.fs index b2c3a569..163d95a8 100644 --- a/build/scripts/Targets.fs +++ b/build/scripts/Targets.fs @@ -83,30 +83,23 @@ let private validatePackages (arguments:ParseResults) = let args = ["-v"; currentVersionInformational.Value; "-k"; Paths.SignKey; "-t"; output] @ jenkinsOnWindowsArgs nugetPackages |> Seq.iter (fun p -> exec "dotnet" (["nupkg-validator"; p] @ args) |> ignore) -let private generateApiChanges (arguments:ParseResults) = - let output = Paths.RootRelative <| Paths.Output.FullName - let currentVersion = currentVersion.Value - let nugetPackages = - Paths.Output.GetFiles("*.nupkg") |> Seq.sortByDescending(fun f -> f.CreationTimeUtc) - |> Seq.map (fun p -> Path.GetFileNameWithoutExtension(Paths.RootRelative p.FullName).Replace("." + currentVersion, "")) - nugetPackages - |> Seq.iter(fun p -> - let outputFile = - let f = sprintf "breaking-changes-%s.md" p - Path.Combine(output, f) - let directory = $".artifacts/bin/%s{p}/release_%s{Paths.MainTFM}" +let private apiArgs (mode:string list) = + let projects = + [ "src/Elastic.Transport/Elastic.Transport.csproj" + "src/Elastic.Transport.VirtualizedCluster/Elastic.Transport.VirtualizedCluster.csproj" ] + |> List.collect (fun p -> ["--project"; p]) + ["assembly-differ"; "api"] @ mode @ projects + +// writes the public API of the Release build to api/, run it after an intended API change and commit the result +let private writeApi (arguments:ParseResults) = + exec "dotnet" ["build"; "-c"; "Release"] |> ignore + exec "dotnet" (apiArgs ["-o"; "api"]) |> ignore + +// fails when api/ no longer matches the Release build +let private verifyApi (arguments:ParseResults) = + exec "dotnet" ["build"; "-c"; "Release"] |> ignore + exec "dotnet" (apiArgs ["--verify"; "api"]) |> ignore - let args = - [ - "assembly-differ" - (sprintf "previous-nuget|%s|%s|%s" p currentVersion Paths.MainTFM); - (sprintf "directory|%s" directory); - "-a"; "true"; "--target"; p; "-f"; "github-comment"; "--output"; outputFile - ] - - exec "dotnet" args |> ignore - ) - let private generateReleaseNotes (arguments:ParseResults) = let currentVersion = currentVersion.Value let output = @@ -174,10 +167,11 @@ let Setup (parsed:ParseResults) (subCommand:Arguments) = step GeneratePackages.Name generatePackages step ValidatePackages.Name validatePackages step GenerateReleaseNotes.Name generateReleaseNotes - step GenerateApiChanges.Name generateApiChanges + step Api.Name writeApi + step VerifyApi.Name verifyApi cmd Release.Name (Some [PristineCheck.Name; Test.Name;]) - (Some [GeneratePackages.Name; ValidatePackages.Name; GenerateReleaseNotes.Name; GenerateApiChanges.Name]) + (Some [GeneratePackages.Name; ValidatePackages.Name; GenerateReleaseNotes.Name; VerifyApi.Name]) <| fun _ -> release parsed step CreateReleaseOnGithub.Name createReleaseOnGithub diff --git a/dotnet-tools.json b/dotnet-tools.json index 6a2e0b1b..ebd4976a 100644 --- a/dotnet-tools.json +++ b/dotnet-tools.json @@ -10,7 +10,7 @@ "rollForward": false }, "assembly-differ": { - "version": "0.17.0", + "version": "1.2.1", "commands": [ "assembly-differ" ], From e6764cd6e872ee26456a27c98d9003a90e129857 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 24 Nov 2026 15:49:45 +0100 Subject: [PATCH 02/12] Commit the approved public API as api/*.api Co-Authored-By: Claude Sonnet 5.5 --- api/Elastic.Transport.VirtualizedCluster.api | 211 +++ api/Elastic.Transport.net10.0.api | 1605 ++++++++++++++++++ api/Elastic.Transport.net462.api | 1495 ++++++++++++++++ api/Elastic.Transport.net8.0.api | 1576 +++++++++++++++++ api/Elastic.Transport.netstandard2.0.api | 1506 ++++++++++++++++ api/Elastic.Transport.netstandard2.1.api | 1508 ++++++++++++++++ 6 files changed, 7901 insertions(+) create mode 100644 api/Elastic.Transport.VirtualizedCluster.api create mode 100644 api/Elastic.Transport.net10.0.api create mode 100644 api/Elastic.Transport.net462.api create mode 100644 api/Elastic.Transport.net8.0.api create mode 100644 api/Elastic.Transport.netstandard2.0.api create mode 100644 api/Elastic.Transport.netstandard2.1.api diff --git a/api/Elastic.Transport.VirtualizedCluster.api b/api/Elastic.Transport.VirtualizedCluster.api new file mode 100644 index 00000000..5c902e70 --- /dev/null +++ b/api/Elastic.Transport.VirtualizedCluster.api @@ -0,0 +1,211 @@ +assembly Elastic.Transport.VirtualizedCluster +using Elastic.Transport: BoundConfiguration, DateTimeProvider, Endpoint, IRequestConfiguration, ITransport<>, ITransportConfiguration, Node, NodePool, PostData, RequestConfigurationDescriptor, RequestPipeline, RequestPipelineFactory, ResponseFactory, TransportConfigurationDescriptor, TransportException, TransportResponse, UnexpectedTransportException +using interface Elastic.Transport: IRequestInvoker +using Elastic.Transport.Diagnostics.Auditing: Audit +using struct Elastic.Transport.Diagnostics.Auditing: AuditEvent +using Elastic.Transport.Products: ProductRegistration +using System: Action<,>, Action<>, Exception, Func<,,>, Func<,>, Func<> +using struct System: DateTimeOffset, TimeSpan +using interface System: IDisposable +using System.Collections.Generic: IEnumerable<>, IList<>, IReadOnlyList<>, List<> +using struct System.Threading: CancellationToken +using System.Threading.Tasks: Task<> + +namespace Elastic.Transport.VirtualizedCluster + static class Virtual + static ElasticsearchClusterFactory Elasticsearch { get; } + +namespace Elastic.Transport.VirtualizedCluster.Audit + sealed class Auditor + Auditor(Func setup) + Action AssertPoolAfterCall { get; set; } + Action AssertPoolAfterStartup { get; set; } + Action AssertPoolBeforeCall { get; set; } + Action AssertPoolBeforeStartup { get; set; } + IEnumerable AsyncAuditTrail { get; set; } + IEnumerable AuditTrail { get; set; } + Func Cluster { get; } + TransportResponse Response { get; } + TransportResponse ResponseAsync { get; } + void ChangeTime(Func selector) + Task TraceCall(ClientCall callTrace, int nthCall = 0) + Task TraceCalls(params ClientCall[] audits) + Task TraceElasticsearchException(ClientCall callTrace, Action assert) + Task TraceElasticsearchExceptionOnResponse(ClientCall callTrace, Action assert) + Task TraceStartup(ClientCall callTrace = null) + Task TraceUnexpectedException(ClientCall callTrace, Action assert) + Task TraceUnexpectedTransportException(ClientCall callTrace, Action assert) + void VisualizeCalls(int numberOfCalls) + + sealed class CallTraceState + CallTraceState(AuditEvent e) + Action AssertWithBecause { get; set; } + AuditEvent Event { get; } + int? Port { get; set; } + Action SimpleAssert { get; set; } + + sealed class ClientCall : List + ClientCall() + ClientCall(Func requestOverrides) + Action AssertPoolAfterCall { get; } + Action AssertResponse { get; } + Func RequestOverrides { get; } + void Add(AuditEvent key, Action value) + void Add(AuditEvent key, int port, Action assertResponse) + void Add(AuditEvent key, int port) + void Add(AuditEvent key) + void Add(Action pool) + +namespace Elastic.Transport.VirtualizedCluster.Components + sealed class ExposingPipelineFactory : RequestPipelineFactory where TConfiguration : class, ITransportConfiguration + ExposingPipelineFactory(TConfiguration configuration) + ITransport Transport { get; } + override RequestPipeline Create(BoundConfiguration boundConfiguration) + + sealed class SealedVirtualCluster : IDisposable + VirtualizedCluster AllDefaults() + void Dispose() + VirtualizedCluster Settings(Func selector) + VirtualClusterRequestInvoker VirtualClusterConnection(Func selector = null) + + class VirtualCluster + protected VirtualCluster(IEnumerable nodes, MockProductRegistration productRegistration) + List ClientCallRules { get; } + protected List InternalNodes { get; } + IReadOnlyList Nodes { get; } + List PingingRules { get; } + MockProductRegistration ProductRegistration { get; } + List SniffingRules { get; } + VirtualCluster ClientCalls(Func selector) + VirtualCluster Ping(Func selector) + VirtualCluster PublishAddress(string publishHost) + SealedVirtualCluster SingleNodeConnection(Func, IEnumerable> seedNodesSelector = null) + VirtualCluster Sniff(Func selector) + VirtualCluster SniffElasticsearchVersionNumber(string version) + VirtualCluster SniffShouldReturnFqdn() + SealedVirtualCluster SniffingNodePool(Func, IEnumerable> seedNodesSelector = null) + SealedVirtualCluster StaticNodePool(Func, IEnumerable> seedNodesSelector = null) + SealedVirtualCluster StickyNodePool(Func, IEnumerable> seedNodesSelector = null) + SealedVirtualCluster StickySniffingNodePool(Func sorter = null, Func, IEnumerable> seedNodesSelector = null) + + class VirtualClusterRequestInvoker : IRequestInvoker, IDisposable + ResponseFactory ResponseFactory { get; } + static VirtualClusterRequestInvoker Error() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + static VirtualClusterRequestInvoker Success(byte[] response) + + class VirtualizedCluster + VirtualClusterRequestInvoker Connection { get; } + NodePool ConnectionPool { get; } + ITransport RequestHandler { get; } + void ChangeTime(Func change) + TransportResponse ClientCall(Func requestOverrides = null) + Task ClientCallAsync(Func requestOverrides = null) + void ClientThrows(bool throws) + VirtualizedCluster TransportProxiesTo(Func, Func, TransportResponse> sync, Func, Func, Task> async) + +namespace Elastic.Transport.VirtualizedCluster.Products + abstract class MockProductRegistration + protected MockProductRegistration() + abstract ProductRegistration ProductRegistration { get; } + abstract byte[] CreateSniffResponseBytes(IReadOnlyList nodes, string stackVersion, string publishAddressOverride, bool returnFullyQualifiedDomainNames) + abstract bool IsPingRequest(Endpoint endpoint) + abstract bool IsSniffRequest(Endpoint endpoint) + +namespace Elastic.Transport.VirtualizedCluster.Products.Elasticsearch + sealed class ElasticsearchClusterFactory + ElasticsearchVirtualCluster Bootstrap(IEnumerable nodes) + ElasticsearchVirtualCluster Bootstrap(int numberOfNodes, int startFrom = 9200) + ElasticsearchVirtualCluster BootstrapAllMasterEligableOnly(int numberOfNodes, int startFrom = 9200) + + sealed class ElasticsearchMockProductRegistration : MockProductRegistration + ElasticsearchMockProductRegistration() + static MockProductRegistration Default { get; } + override ProductRegistration ProductRegistration { get; } + override byte[] CreateSniffResponseBytes(IReadOnlyList nodes, string stackVersion, string publishAddressOverride, bool returnFullyQualifiedDomainNames) + override bool IsPingRequest(Endpoint endpoint) + override bool IsSniffRequest(Endpoint endpoint) + + static class ElasticsearchSniffResponseFactory + static byte[] Create(IEnumerable nodes, string elasticsearchVersion, string publishAddressOverride, bool randomFqdn = false) + + class ElasticsearchVirtualCluster : VirtualCluster + ElasticsearchVirtualCluster(IEnumerable nodes) + ElasticsearchVirtualCluster HasSetting(string key, string value, params int[] ports) + VirtualCluster HttpDisabled(params int[] ports) + ElasticsearchVirtualCluster MasterEligible(params int[] ports) + ElasticsearchVirtualCluster StoresNoData(params int[] ports) + +namespace Elastic.Transport.VirtualizedCluster.Providers + sealed class TestableDateTimeProvider : DateTimeProvider + TestableDateTimeProvider() + void ChangeTime(Func change) + override DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + override DateTimeOffset Now() + +namespace Elastic.Transport.VirtualizedCluster.Rules + sealed class ClientCallRule : RuleBase, IClientCallRule, IRule + ClientCallRule() + ClientCallRule AfterSucceeds(RuleOption errorState = null) + ClientCallRule FailAlways(RuleOption errorState = null) + ClientCallRule Fails(RuleOption times, RuleOption errorState = null) + ClientCallRule SucceedAlways(int? validResponseCode = 200) + ClientCallRule Succeeds(RuleOption times, int? validResponseCode = 200) + ClientCallRule ThrowsAfterSucceeds() + + interface IClientCallRule : IRule + + interface IRule + RuleOption AfterSucceeds { get; set; } + int ExecuteCount { get; } + int? OnPort { get; set; } + Func PathFilter { get; set; } + RuleOption Return { get; set; } + string ReturnContentType { get; set; } + byte[] ReturnResponse { get; set; } + bool Succeeds { get; set; } + TimeSpan? Takes { get; set; } + RuleOption Times { get; set; } + void RecordExecuted() + + interface ISniffRule : IRule + VirtualCluster NewClusterState { get; set; } + + sealed class PingRule : RuleBase + PingRule() + PingRule FailAlways(RuleOption errorState = null) + PingRule Fails(RuleOption times, RuleOption errorState = null) + PingRule SucceedAlways(int? validResponseCode = 200) + PingRule Succeeds(RuleOption times, int? validResponseCode = 200) + + abstract class RuleBase : IRule where TRule : RuleBase, IRule + protected RuleBase() + TRule OnPath(Func pathPredicate) + TRule OnPath(string pathContains) + TRule OnPort(int port) + TRule ReturnByteResponse(byte[] response, string responseContentType = "application/json") + TRule ReturnResponse(T response) where T : class + TRule Takes(TimeSpan span) + + sealed class RuleOption + RuleOption(TFirst item) + RuleOption(TSecond item) + void Match(Action first, Action second) + T Match(Func first, Func second) + static implicit operator RuleOption(TFirst first) + static implicit operator RuleOption(TSecond second) + + sealed class SniffRule : RuleBase, ISniffRule, IRule + SniffRule() + SniffRule FailAlways(RuleOption errorState = null) + SniffRule Fails(RuleOption times, RuleOption errorState = null) + SniffRule SucceedAlways(VirtualCluster cluster = null) + SniffRule Succeeds(RuleOption times, VirtualCluster cluster = null) + + static class TimesHelper + static readonly TimesHelper.AllTimes Always + static readonly int Once + static readonly int Twice + static int Times(int n) + class AllTimes diff --git a/api/Elastic.Transport.net10.0.api b/api/Elastic.Transport.net10.0.api new file mode 100644 index 00000000..8ca31d4b --- /dev/null +++ b/api/Elastic.Transport.net10.0.api @@ -0,0 +1,1605 @@ +assembly Elastic.Transport +using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri +using struct System: DateTime, DateTimeOffset, Guid, ReadOnlyMemory<>, ReadOnlySpan<>, TimeSpan, TypeCode +using interface System: IAsyncDisposable, IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> +using System.CodeDom.Compiler: GeneratedCodeAttribute +using interface System.Collections: IEnumerable +using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> +using struct System.Collections.Generic: KeyValuePair<,> +using interface System.Collections.Generic: ICollection<>, IDictionary<,>, IEnumerable<>, IReadOnlyCollection<> +using System.Collections.ObjectModel: ReadOnlyDictionary<,> +using System.Collections.Specialized: NameValueCollection +using System.ComponentModel: BrowsableAttribute, EditorBrowsableAttribute +using System.Diagnostics: Activity +using System.Diagnostics.CodeAnalysis: NotNullWhenAttribute, UnconditionalSuppressMessageAttribute +using System.Dynamic: BinaryOperationBinder, ConvertBinder, DynamicObject, GetMemberBinder, SetMemberBinder +using System.IO: MemoryStream, Stream +using System.IO.Pipelines: PipeReader, PipeWriter +using System.Linq: IOrderedEnumerable<> +using System.Net: HttpWebRequest, ServicePoint +using System.Net.Http: HttpMessageHandler +using struct System.Net.NetworkInformation: TcpState +using struct System.Net.Security: SslPolicyErrors +using System.Runtime.Serialization: DataContractAttribute, DataMemberAttribute, EnumMemberAttribute +using System.Security.Cryptography.X509Certificates: X509Certificate, X509CertificateCollection, X509Chain +using struct System.Security.Cryptography.X509Certificates: X509RevocationMode +using System.Text: StringBuilder +using System.Text.Json: JsonSerializerOptions, Utf8JsonWriter +using struct System.Text.Json: JsonElement, Utf8JsonReader +using System.Text.Json.Nodes: JsonNode +using System.Text.Json.Serialization: JsonConverter, JsonConverter<>, JsonConverterAttribute, JsonIgnoreAttribute, JsonNumberHandlingAttribute, JsonPropertyNameAttribute, JsonSerializableAttribute, JsonSerializerContext, JsonSourceGenerationOptionsAttribute +using System.Text.Json.Serialization.Metadata: JsonTypeInfo, JsonTypeInfo<> +using interface System.Text.Json.Serialization.Metadata: IJsonTypeInfoResolver +using System.Text.RegularExpressions: Regex +using System.Threading: SemaphoreSlim +using struct System.Threading: CancellationToken +using System.Threading.Tasks: Task, Task<> +using struct System.Threading.Tasks: ValueTask, ValueTask<> + +namespace Elastic.Transport + sealed class ApiCallDetails + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + bool HasExpectedContentType { get; } + bool HasSuccessfulStatusCode { get; } + HttpMethod HttpMethod { get; } + int? HttpStatusCode { get; } + Exception? OriginalException { get; } + ErrorResponse? ProductError { get; } + byte[]? RequestBodyInBytes { get; } + byte[]? ResponseBodyInBytes { get; } + string ResponseContentType { get; set; } + [Obsolete("This property has been retired and replaced by ResponseContentType. Prefer using the updated property as this will be removed in a future release.")] + string ResponseMimeType { get; set; } + Uri? Uri { get; } + override string ToString() + bool TryGetHeader(string key, [NotNullWhen(true)] out IEnumerable? headerValues) + + class ApiKey : AuthorizationHeader + ApiKey(string apiKey) + override string AuthScheme { get; } + override bool TryGetAuthorizationParameters(out string value) + + abstract class AuthorizationHeader + protected AuthorizationHeader() + abstract string AuthScheme { get; } + abstract bool TryGetAuthorizationParameters(out string value) + + class Base64ApiKey : ApiKey + Base64ApiKey(string id, string apiKey) + Base64ApiKey(string base64EncodedApiKey) + + sealed class BasicAuthentication : AuthorizationHeader + BasicAuthentication(string username, string password) + override string AuthScheme { get; } + static string BasicAuthenticationScheme { get; } + static string GetBase64String(string header) + override bool TryGetAuthorizationParameters(out string value) + + sealed record BoundConfiguration : IRequestConfiguration, IEquatable + BoundConfiguration(ITransportConfiguration global, IRequestConfiguration? local = null) + const string DefaultContentType = "application/json" + const string RunAsSecurityHeader = "es-security-runas-user" + string Accept { get; } + IReadOnlyCollection AllowedStatusCodes { get; } + AuthorizationHeader? AuthenticationHeader { get; } + X509CertificateCollection? ClientCertificates { get; } + ITransportConfiguration ConnectionSettings { get; } + string ContentType { get; } + bool DisableAuditTrail { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableDirectStreaming { get; } + bool DisablePings { get; } + bool DisableSniff { get; } + TimeSpan DnsRefreshTimeout { get; } + bool EnableTcpStats { get; } + bool EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool HttpCompression { get; } + bool HttpPipeliningEnabled { get; } + int KeepAliveInterval { get; } + int KeepAliveTime { get; } + int MaxRetries { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + string? OpaqueId { get; } + bool ParseAllHeaders { get; } + TimeSpan PingTimeout { get; } + IReadOnlyCollection ProductResponseBuilders { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + IReadOnlyCollection SkipDeserializationForStatusCodes { get; } + bool ThrowExceptions { get; } + bool TransferEncodingChunked { get; } + UserAgent UserAgent { get; } + BoundConfiguration $() + static BoundConfiguration Create(ITransport transport, IRequestConfiguration requestConfiguration) + bool Equals(BoundConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool operator ==(BoundConfiguration? left, BoundConfiguration? right) + static bool operator !=(BoundConfiguration? left, BoundConfiguration? right) + + sealed class BytesResponse : TransportResponse + BytesResponse() + BytesResponse(byte[] body) + + static class CertificateValidations + static bool AllowAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + static Func AuthorityIsRoot(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static Func AuthorityPartOfChain(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static bool DenyAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + + sealed class CloudNodePool : SingleNodePool + CloudNodePool(string cloudId, AuthorizationHeader credentials, CloudService service) + CloudNodePool(string cloudId, AuthorizationHeader credentials) + CloudNodePool(Uri cloudEndpoint, AuthorizationHeader credentials) + AuthorizationHeader AuthenticationHeader { get; } + + enum CloudService + Elasticsearch = 0 + Kibana = 1 + + abstract class DateTimeProvider + abstract DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + abstract DateTimeOffset Now() + + sealed class DefaultDateTimeProvider : DateTimeProvider + DefaultDateTimeProvider() + static readonly DefaultDateTimeProvider Default + override DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + override DateTimeOffset Now() + + sealed class DefaultMemoryStreamFactory : MemoryStreamFactory + DefaultMemoryStreamFactory() + static DefaultMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class DefaultMetaHeaderProducer : MetaHeaderProducer + DefaultMetaHeaderProducer(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProducer(Type clientType, string serviceIdentifier) + override string HeaderName { get; } + override string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + sealed class DefaultMetaHeaderProvider : MetaHeaderProvider + DefaultMetaHeaderProvider(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProvider(Type clientType, string serviceIdentifier) + override MetaHeaderProducer[] Producers { get; } + + sealed class DefaultRequestParameters : RequestParameters + DefaultRequestParameters() + + sealed class DistributedTransport : DistributedTransport + DistributedTransport(ITransportConfiguration configuration) + + class DistributedTransport : ITransport, ITransport where TConfiguration : class, ITransportConfiguration + DistributedTransport(TConfiguration configuration) + TConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + sealed class DynamicDictionary : DynamicObject, IEquatable, IDictionary, ICollection>, IEnumerable>, IEnumerable + DynamicDictionary() + int Count { get; } + static DynamicDictionary Empty { get; } + bool IsReadOnly { get; } + DynamicValue this[string name] { get; set; } + ICollection Keys { get; } + ICollection Values { get; } + void Add(KeyValuePair item) + void Add(string key, DynamicValue value) + void Clear() + bool Contains(KeyValuePair item) + bool ContainsKey(string key) + void CopyTo(KeyValuePair[] array, int arrayIndex) + static DynamicDictionary Create(IDictionary values) + static DynamicDictionary Create(JsonElement e) + bool Equals(DynamicDictionary? other) + override bool Equals(object? obj) + T Get(string? path) + override IEnumerable GetDynamicMemberNames() + override int GetHashCode() + bool Remove(KeyValuePair item) + bool Remove(string key) + Dictionary ToDictionary() + override bool TryGetMember(GetMemberBinder binder, out object result) + bool TryGetValue(string key, out DynamicValue value) + override bool TrySetMember(SetMemberBinder binder, object? value) + + sealed class DynamicResponse : DynamicResponseBase + DynamicResponse() + DynamicResponse(DynamicDictionary dictionary) + + abstract class DynamicResponseBase : TransportResponse + protected DynamicResponseBase() + protected DynamicResponseBase(DynamicDictionary dictionary) + T Get(string path) + + sealed class DynamicValue : DynamicObject, IEquatable, IConvertible, IReadOnlyCollection, IEnumerable, IEnumerable + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + DynamicValue(object? value) + int Count { get; } + bool HasValue { get; } + DynamicValue this[int i] { get; } + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "Manually verified")] + DynamicValue this[string name] { get; } + static DynamicValue NullValue { get; } + object? Value { get; } + static object? ConsumeJsonElement(Type targetReturnType, JsonElement e) + T? Default(T? defaultValue = null) + bool Equals(DynamicValue? compareValue) + override bool Equals(object? obj) + T? Get(string path) + IEnumerator GetEnumerator() + override int GetHashCode() + TypeCode GetTypeCode() + static DynamicValue SelfOrNew(object v) + bool ToBoolean(IFormatProvider? provider) + byte ToByte(IFormatProvider? provider) + char ToChar(IFormatProvider? provider) + DateTime ToDateTime(IFormatProvider? provider) + decimal ToDecimal(IFormatProvider? provider) + IDictionary? ToDictionary() + double ToDouble(IFormatProvider? provider) + IEnumerable ToEnumerable() + short ToInt16(IFormatProvider? provider) + int ToInt32(IFormatProvider? provider) + long ToInt64(IFormatProvider? provider) + [CLSCompliant(false)] + sbyte ToSByte(IFormatProvider? provider) + float ToSingle(IFormatProvider? provider) + override string? ToString() + string ToString(IFormatProvider? provider) + object ToType(Type conversionType, IFormatProvider? provider) + [CLSCompliant(false)] + ushort ToUInt16(IFormatProvider? provider) + [CLSCompliant(false)] + uint ToUInt32(IFormatProvider? provider) + [CLSCompliant(false)] + ulong ToUInt64(IFormatProvider? provider) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "Manually verified")] + override bool TryBinaryOperation(BinaryOperationBinder binder, object arg, out object? result) + override bool TryConvert(ConvertBinder binder, out object? result) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "Manually verified")] + override bool TryGetMember(GetMemberBinder binder, out object? result) + T? TryParse(T? defaultValue = null) + static bool operator ==(DynamicValue dynamicValue, object compareValue) + static bool operator !=(DynamicValue dynamicValue, object compareValue) + static implicit operator bool(DynamicValue dynamicValue) + static implicit operator string?(DynamicValue dynamicValue) + static implicit operator int(DynamicValue dynamicValue) + static implicit operator Guid(DynamicValue dynamicValue) + static implicit operator DateTime(DynamicValue dynamicValue) + static implicit operator DateTimeOffset(DynamicValue dynamicValue) + static implicit operator TimeSpan(DynamicValue dynamicValue) + static implicit operator long(DynamicValue dynamicValue) + static implicit operator float(DynamicValue dynamicValue) + static implicit operator decimal(DynamicValue dynamicValue) + static implicit operator double(DynamicValue dynamicValue) + + record Endpoint : IEquatable + Endpoint(in EndpointPath Path, Node Node) + protected Endpoint(Endpoint original) + protected virtual Type EqualityContract { get; } + bool IsEmpty { get; } + HttpMethod Method { get; } + Node Node { get; init; } + EndpointPath Path { get; init; } + string PathAndQuery { get; } + Uri Uri { get; } + virtual Endpoint $() + void Deconstruct(out EndpointPath Path, out Node Node) + static Endpoint Empty(in EndpointPath path) + virtual bool Equals(Endpoint? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(Endpoint? left, Endpoint? right) + static bool operator !=(Endpoint? left, Endpoint? right) + + readonly struct EndpointPath : IEquatable + EndpointPath(HttpMethod Method, string PathAndQuery) + HttpMethod Method { get; init; } + string PathAndQuery { get; init; } + void Deconstruct(out HttpMethod Method, out string PathAndQuery) + bool Equals(EndpointPath other) + override bool Equals(object obj) + override int GetHashCode() + override string ToString() + static bool operator ==(EndpointPath left, EndpointPath right) + static bool operator !=(EndpointPath left, EndpointPath right) + + class ErrorCauseConverter : ErrorCauseConverter + ErrorCauseConverter() + + abstract class ErrorCauseConverter : JsonConverter where TErrorCause : ErrorCause, new() + protected ErrorCauseConverter() + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override TErrorCause? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + protected virtual bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, TErrorCause errorCause) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override void Write(Utf8JsonWriter writer, TErrorCause value, JsonSerializerOptions options) + + class ErrorConverter : ErrorCauseConverter + ErrorConverter() + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + protected override bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, Error errorCause) + + abstract class ErrorResponse + abstract bool HasError() + + readonly struct HeadersList : IEnumerable, IEnumerable + HeadersList(IEnumerable headers, IEnumerable otherHeaders) + HeadersList(IEnumerable headers, string additionalHeader) + HeadersList(IEnumerable headers) + HeadersList(HeadersList? headers, HeadersList? otherHeaders) + HeadersList(string header) + int Count { get; } + IEnumerator GetEnumerator() + + enum HttpMethod + [EnumMember(Value = "GET")] + GET = 0 + [EnumMember(Value = "POST")] + POST = 1 + [EnumMember(Value = "PUT")] + PUT = 2 + [EnumMember(Value = "DELETE")] + DELETE = 3 + [EnumMember(Value = "HEAD")] + HEAD = 4 + + static class HttpMethodExtensions + static string GetStringValue(this HttpMethod httpMethod) + + class HttpRequestInvoker : IRequestInvoker, IDisposable + HttpRequestInvoker() + HttpRequestInvoker(Func wrappingHandler) + int InUseHandlers { get; } + int RemovedHandlers { get; } + ResponseFactory ResponseFactory { get; } + protected HttpMessageHandler CreateHttpClientHandler(BoundConfiguration boundConfiguration) + void Dispose() + virtual void DisposeManagedResources() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + [Obsolete("CoreFX HttpWebRequest uses HttpClient under the covers but does not reuse HttpClient instances, do NOT use on .NET core only used as the default on Full Framework")] + class HttpWebRequestInvoker : IRequestInvoker, IDisposable + HttpWebRequestInvoker() + ResponseFactory ResponseFactory { get; } + protected virtual void AlterServicePoint(ServicePoint requestServicePoint, BoundConfiguration boundConfiguration) + protected virtual HttpWebRequest CreateHttpWebRequest(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, bool isAsync) + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected virtual void SetAuthenticationIfNeeded(Endpoint endpoint, BoundConfiguration boundConfiguration, HttpWebRequest request) + protected virtual void SetClientCertificates(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetProxyIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetServerCertificateValidationCallBackIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + + interface IJsonSerializerOptionsProvider + JsonSerializerOptions CreateJsonSerializerOptions() + + interface IRequestConfiguration + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; } + AuthorizationHeader? Authentication { get; } + X509CertificateCollection? ClientCertificates { get; } + string? ContentType { get; } + bool? DisableAuditTrail { get; } + bool? DisableDirectStreaming { get; } + bool? DisablePings { get; } + bool? DisableSniff { get; } + bool? EnableHttpCompression { get; } + bool? EnableTcpStats { get; } + bool? EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool? HttpPipeliningEnabled { get; } + int? MaxRetries { get; } + TimeSpan? MaxRetryTimeout { get; } + string? OpaqueId { get; } + bool? ParseAllHeaders { get; } + TimeSpan? PingTimeout { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan? RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + bool? ThrowExceptions { get; } + bool? TransferEncodingChunked { get; } + UserAgent? UserAgent { get; } + + interface IRequestInvoker : IDisposable + ResponseFactory ResponseFactory { get; } + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + interface IResponseBuilder + TResponse? Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) where TResponse : TransportResponse, new() + Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + bool CanBuild() where TResponse : TransportResponse, new() + + interface IStringable + string GetString() + + interface ITransport + ITransportConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + interface ITransportConfiguration : IRequestConfiguration, IDisposable + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; } + int ConnectionLimit { get; } + DateTimeProvider? DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableMetaHeader { get; } + TimeSpan DnsRefreshTimeout { get; } + TimeSpan? KeepAliveInterval { get; } + TimeSpan? KeepAliveTime { get; } + TimeSpan? MaxDeadTimeout { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + NodePool NodePool { get; } + Func? NodePredicate { get; } + Action? OnConfigurationBound { get; } + Action? OnRequestCompleted { get; } + RequestPipelineFactory? PipelineProvider { get; } + bool PrettyJson { get; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + NameValueCollection? QueryStringParameters { get; } + IRequestInvoker RequestInvoker { get; } + Serializer RequestResponseSerializer { get; } + Func? ServerCertificateValidationCallback { get; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; } + TimeSpan? SniffInformationLifeSpan { get; } + bool SniffsOnConnectionFault { get; } + bool SniffsOnStartup { get; } + Func StatusCodeToResponseSuccess { get; } + UrlFormatter UrlFormatter { get; } + + interface ITransport : ITransport where TConfiguration : class, ITransportConfiguration + TConfiguration Configuration { get; } + + interface IUrlParameter + string GetString(ITransportConfiguration settings) + + class InMemoryRequestInvoker : IRequestInvoker, IDisposable + InMemoryRequestInvoker() + InMemoryRequestInvoker(byte[]? responseBody, int statusCode = 200, Exception? exception = null, string contentType = "application/json", Dictionary>? headers = null) + ResponseFactory ResponseFactory { get; } + TResponse BuildResponse(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + Task BuildResponseAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + sealed class JsonResponse : JsonResponseBase + JsonResponse() + JsonResponse(JsonNode node) + + abstract class JsonResponseBase : TransportResponse + protected JsonResponseBase() + protected JsonResponseBase(JsonNode node) + T Get(string path) + + abstract class MemoryStreamFactory + protected MemoryStreamFactory() + abstract MemoryStream Create() + abstract MemoryStream Create(byte[] bytes, int index, int count) + abstract MemoryStream Create(byte[] bytes) + + sealed class MetaDataHeader + MetaDataHeader(VersionInfo version, string serviceIdentifier, bool isAsync) + string ClientVersion { get; } + string RuntimeVersion { get; } + string ServiceIdentifier { get; } + string? TransportVersion { get; } + override string ToString() + + abstract class MetaHeaderProducer + protected MetaHeaderProducer() + abstract string HeaderName { get; } + abstract string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + abstract class MetaHeaderProvider + protected MetaHeaderProvider() + abstract MetaHeaderProducer[] Producers { get; } + + sealed class Node : IEquatable + Node(Uri uri, IEnumerable? features = null) + DateTimeOffset DeadUntil { get; } + int FailedAttempts { get; } + IReadOnlyCollection Features { get; set; } + string? Id { get; } + bool IsAlive { get; } + bool IsResurrected { get; set; } + string? Name { get; set; } + IReadOnlyDictionary Settings { get; set; } + Uri Uri { get; } + Node Clone() + Uri CreatePath(string path) + bool Equals(Node? other) + override bool Equals(object? obj) + override int GetHashCode() + bool HasFeature(string feature) + void MarkAlive() + void MarkDead(DateTimeOffset until) + static bool operator ==(Node left, Node right) + static bool operator !=(Node left, Node right) + static implicit operator Node(Uri uri) + + abstract class NodePool : IDisposable + protected NodePool() + DateTimeProvider DateTimeProvider { get; set; } + abstract DateTimeOffset? LastUpdate { get; protected set; } + abstract int MaxRetries { get; } + abstract IReadOnlyCollection Nodes { get; } + bool SniffedOnStartup { get; } + abstract bool SupportsPinging { get; } + abstract bool SupportsReseeding { get; } + bool UsingSsl { get; protected set; } + abstract IEnumerable CreateView(Auditor? auditor = null) + void Dispose() + protected virtual void Dispose(bool disposing) + void MarkAsSniffed() + abstract void Reseed(IEnumerable nodes) + + sealed class PipeResponse : PipeResponseBase + PipeResponse() + PipeResponse(Stream responseStream, string? contentType) + PipeReader Body { get; } + + abstract class PipeResponseBase : TransportResponse, IAsyncDisposable, IDisposable + protected PipeResponseBase(Stream responseStream, string? contentType) + string ContentType { get; } + protected internal override bool LeaveOpen { get; } + protected PipeReader Pipe { get; } + Task CopyToAsync(PipeWriter destination, CancellationToken cancellationToken = default) + void Dispose() + ValueTask DisposeAsync() + + class PipelineException : Exception + PipelineException(PipelineFailure failure, Exception? innerException) + PipelineException(PipelineFailure failure) + PipelineFailure FailureReason { get; } + bool Recoverable { get; } + TransportResponse? Response { get; } + + enum PipelineFailure + BadAuthentication = 0 + BadResponse = 1 + PingFailure = 2 + SniffFailure = 3 + CouldNotStartSniffOnStartup = 4 + MaxTimeoutReached = 5 + MaxRetriesReached = 6 + Unexpected = 7 + BadRequest = 8 + NoNodesAttempted = 9 + + abstract class PostData + protected PostData() + protected const int BufferSize = 81920 + protected static readonly byte[] NewLineByteArray + static PostData Empty { get; } + PostType Type { get; } + byte[]? WrittenBytes { get; } + protected void BufferIfNeeded(MemoryStreamFactory memoryStreamFactory, bool disableDirectStreaming, ref MemoryStream? buffer, ref Stream stream) + static PostData Bytes(byte[] bytes) + protected void FinishStream(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming) + protected ValueTask FinishStreamAsync(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming, CancellationToken ctx) + static PostData MultiJson(IEnumerable listOfSerializables) + static PostData MultiJson(IEnumerable listOfString) + static PostData PipeReader(PipeReader pipeReader) + static PostData PipeWriter(T state, Func asyncWriter) + static PostData ReadOnlyMemory(ReadOnlyMemory bytes) + static PostData Serializable(T data) + static PostData StreamHandler(T state, Action syncWriter, Func asyncWriter) + static PostData String(string serializedString) + abstract void Write(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming) + abstract Task WriteAsync(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming, CancellationToken cancellationToken) + static implicit operator PostData(byte[] byteArray) + static implicit operator PostData(string literalString) + + enum PostType + ByteArray = 0 + ReadOnlyMemory = 1 + LiteralString = 2 + Serializable = 3 + EnumerableOfString = 4 + EnumerableOfObject = 5 + StreamHandler = 6 + Pipe = 7 + + sealed class RecyclableMemoryStreamFactory : MemoryStreamFactory + RecyclableMemoryStreamFactory() + static RecyclableMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class ReflectionVersionInfo : VersionInfo + static readonly string TransportVersion + static ReflectionVersionInfo Create() + static ReflectionVersionInfo Create(Type type) + + record RequestConfiguration : IRequestConfiguration, IEquatable + RequestConfiguration() + RequestConfiguration(IRequestConfiguration config) + protected RequestConfiguration(RequestConfiguration original) + static readonly TimeSpan DefaultPingTimeout + static readonly TimeSpan DefaultPingTimeoutOnSsl + static readonly TimeSpan DefaultRequestTimeout + static readonly UserAgent DefaultUserAgent + string? Accept { get; init; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + string? ContentType { get; init; } + bool? DisableAuditTrail { get; init; } + bool? DisableDirectStreaming { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestMetaData? RequestMetaData { get; init; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UserAgent? UserAgent { get; init; } + virtual RequestConfiguration $() + virtual bool Equals(RequestConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(RequestConfiguration? left, RequestConfiguration? right) + static bool operator !=(RequestConfiguration? left, RequestConfiguration? right) + + class RequestConfigurationDescriptor : IRequestConfiguration + RequestConfigurationDescriptor() + RequestConfigurationDescriptor(IRequestConfiguration config) + RequestConfigurationDescriptor Accept(string acceptHeader) + RequestConfigurationDescriptor AllowedStatusCodes(IEnumerable? codes) + RequestConfigurationDescriptor AllowedStatusCodes(params int[] codes) + RequestConfigurationDescriptor Authentication(AuthorizationHeader authentication) + RequestConfigurationDescriptor ClientCertificate(X509Certificate certificate) + RequestConfigurationDescriptor ClientCertificate(string certificatePath) + RequestConfigurationDescriptor ClientCertificates(X509CertificateCollection certificates) + RequestConfigurationDescriptor ContentType(string contentTypeHeader) + RequestConfigurationDescriptor DisableAuditTrail(bool disable = true) + RequestConfigurationDescriptor DisableDirectStreaming(bool disable = true) + RequestConfigurationDescriptor DisablePing(bool disable = true) + RequestConfigurationDescriptor DisableSniffing(bool disable = true) + RequestConfigurationDescriptor EnableHttpCompression(bool enable = true) + RequestConfigurationDescriptor EnableHttpPipelining(bool enable = true) + RequestConfigurationDescriptor EnableTcpStats(bool enableTcpStats = true) + RequestConfigurationDescriptor EnableThreadPoolStats(bool enableThreadPoolStats = true) + RequestConfigurationDescriptor ForceNode(Uri uri) + RequestConfigurationDescriptor GlobalHeaders(NameValueCollection headers) + RequestConfigurationDescriptor MaxRetries(int retry) + RequestConfigurationDescriptor MaxRetries(TimeSpan? timeout) + RequestConfigurationDescriptor OpaqueId(string opaqueId) + RequestConfigurationDescriptor ParseAllHeaders(bool enable = true) + RequestConfigurationDescriptor PingTimeout(TimeSpan pingTimeout) + RequestConfigurationDescriptor RequestMetaData(RequestMetaData metaData) + RequestConfigurationDescriptor RequestTimeout(TimeSpan requestTimeout) + RequestConfigurationDescriptor ResponseBuilder(IResponseBuilder responseBuilder) + RequestConfigurationDescriptor ResponseHeadersToParse(IEnumerable headers) + RequestConfigurationDescriptor RunAs(string username) + RequestConfigurationDescriptor ThrowExceptions(bool throwExceptions = true) + RequestConfigurationDescriptor TransferEncodingChunked(bool transferEncodingChunked = true) + RequestConfigurationDescriptor UserAgent(UserAgent userAgent) + + sealed class RequestMetaData + RequestMetaData() + IReadOnlyDictionary? Items { get; } + + static class RequestMetaDataExtensions + static void AddHelper(this RequestMetaData metaData, string helperValue) + + abstract class RequestParameters + protected RequestParameters() + Dictionary QueryString { get; } + string? AcceptHeaderFromFormat(string? format) + bool ContainsQueryString(string name) + virtual string CreatePathWithQueryStrings(string? path, ITransportConfiguration? globalConfig) + TOut? GetQueryStringValue(string name) + protected void Q(string name, IStringable value) + protected void Q(string name, object value) + protected TOut? Q(string name) + void SetQueryString(string name, object? value) + + class RequestPipeline + void AuditCancellationRequested(Auditor? auditor) + void BadResponse(ref TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, TransportException exception, IReadOnlyCollection? auditTrail) where TResponse : TransportResponse, new() + TResponse CallProductEndpoint(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor) where TResponse : TransportResponse, new() + Task CallProductEndpointAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + TransportException? CreateClientException(TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, Auditor? auditor, DateTimeOffset startedOn, int attemptedNodes, List? seenExceptions) where TResponse : TransportResponse, new() + void FirstPoolUsage(SemaphoreSlim semaphore, Auditor? auditor) + Task FirstPoolUsageAsync(SemaphoreSlim semaphore, Auditor? auditor, CancellationToken cancellationToken) + void MarkAlive(Node node) + void MarkDead(Node node) + IEnumerable NextNode(DateTimeOffset startedOn, int attemptedNodes, Auditor? auditor) + void Ping(Node node, Auditor? auditor) + Task PingAsync(Node node, Auditor? auditor, CancellationToken cancellationToken = default) + void Sniff(Auditor? auditor) + Task SniffAsync(Auditor? auditor, CancellationToken cancellationToken = default) + void SniffOnConnectionFailure(Auditor? auditor) + Task SniffOnConnectionFailureAsync(Auditor? auditor, CancellationToken cancellationToken) + void SniffOnStaleCluster(Auditor? auditor) + Task SniffOnStaleClusterAsync(Auditor? auditor, CancellationToken cancellationToken) + void ThrowNoNodesAttempted(Endpoint endpoint, Auditor? auditor, List? seenExceptions) + bool TryGetSingleNode(out Node? node) + + abstract class RequestPipelineFactory + abstract RequestPipeline Create(BoundConfiguration boundConfiguration) + + abstract class ResponseFactory + protected ResponseFactory() + abstract TResponse Create(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream? responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats) where TResponse : TransportResponse, new() + abstract Task CreateAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected static bool MayHaveBody(int? statusCode, HttpMethod httpMethod, long contentLength) + + enum SerializationFormatting + None = 0 + Indented = 1 + + abstract class Serializer + protected Serializer() + abstract T Deserialize(Stream stream) + abstract object? Deserialize(Type type, Stream stream) + abstract ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + abstract ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + abstract void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + abstract void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + + sealed class SerializerRegistrationInformation + SerializerRegistrationInformation(Type type, string purpose) + string Purpose { get; } + Type TypeInformation { get; } + override string ToString() + + class SingleNodePool : NodePool + SingleNodePool(Uri uri) + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + + class SniffingNodePool : StaticNodePool + SniffingNodePool(IEnumerable nodes, bool randomize = true) + SniffingNodePool(IEnumerable nodes, Func nodeScorer) + SniffingNodePool(IEnumerable uris, bool randomize = true) + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + protected override void Dispose(bool disposing) + override void Reseed(IEnumerable nodes) + + class StaticNodePool : NodePool + protected StaticNodePool(IEnumerable nodes, bool randomize, int? randomizeSeed = default) + StaticNodePool(IEnumerable nodes, bool randomize = true) + protected StaticNodePool(IEnumerable nodes, Func? nodeScorer = null) + StaticNodePool(IEnumerable uris, bool randomize = true) + protected IReadOnlyList AliveNodes { get; } + protected ref int GlobalCursor { get; } + protected List InternalNodes { get; set; } + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + protected Random Random { get; } + protected bool Randomize { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + protected Node RetryInternalNodes(int globalCursor, Auditor? auditor = null) + protected static IEnumerable SelectAliveNodes(int cursor, IReadOnlyList aliveNodes, Auditor? auditor = null) + protected IOrderedEnumerable SortNodes(IEnumerable nodes) + + sealed class StickyNodePool : StaticNodePool + StickyNodePool(IEnumerable nodes) + StickyNodePool(IEnumerable uris) + override IEnumerable CreateView(Auditor? auditor) + override void Reseed(IEnumerable nodes) + + sealed class StickySniffingNodePool : SniffingNodePool + StickySniffingNodePool(IEnumerable nodes, Func? nodeScorer = null) + StickySniffingNodePool(IEnumerable uris, Func? nodeScorer = null) + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + + sealed class StreamResponse : StreamResponseBase, IDisposable + StreamResponse() + StreamResponse(Stream body, string? contentType) + Stream Body { get; } + + abstract class StreamResponseBase : TransportResponse, IDisposable + protected StreamResponseBase(Stream responseStream, string? contentType = null) + string ContentType { get; } + protected bool Disposed { get; } + protected internal override bool LeaveOpen { get; } + protected Stream Stream { get; } + void Dispose() + protected virtual void Dispose(bool disposing) + + sealed class StringResponse : StringResponseBase + StringResponse() + StringResponse(string body) + + abstract class StringResponseBase : TransportResponse + protected StringResponseBase() + protected StringResponseBase(string body) + + abstract class SystemTextJsonSerializer : Serializer + protected SystemTextJsonSerializer(IJsonSerializerOptionsProvider? provider = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override T Deserialize(Stream stream) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override object? Deserialize(Type type, Stream stream) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + protected internal JsonSerializerOptions GetJsonSerializerOptions(SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + protected internal virtual bool SupportsFastPath(Type type) + + static class TestableResponseFactory + static T CreateResponse(T response, int httpStatusCode, bool statusCodeRepresentsSuccess) where T : TransportResponse + static T CreateSuccessfulResponse(T response, int httpStatusCode) where T : TransportResponse + + record TransportConfiguration : ITransportConfiguration, IRequestConfiguration, IDisposable, IEquatable + TransportConfiguration(ITransportConfiguration config) + TransportConfiguration(NodePool nodePool, IRequestInvoker? requestInvoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + protected TransportConfiguration(TransportConfiguration original) + TransportConfiguration(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri? uri = null, ProductRegistration? productRegistration = null) + static readonly int DefaultConnectionLimit + static readonly TimeSpan DefaultDnsRefreshTimeout + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + int ConnectionLimit { get; init; } + string? ContentType { get; init; } + DateTimeProvider DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; init; } + virtual bool DebugMode { get; init; } + static MemoryStreamFactory DefaultMemoryStreamFactory { get; } + bool? DisableAuditTrail { get; init; } + bool DisableAutomaticProxyDetection { get; init; } + bool? DisableDirectStreaming { get; init; } + bool DisableMetaHeader { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + TimeSpan DnsRefreshTimeout { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + TimeSpan? KeepAliveInterval { get; init; } + TimeSpan? KeepAliveTime { get; init; } + TimeSpan? MaxDeadTimeout { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + MemoryStreamFactory MemoryStreamFactory { get; init; } + MetaHeaderProvider? MetaHeaderProvider { get; init; } + NodePool NodePool { get; } + Func? NodePredicate { get; init; } + Action? OnConfigurationBound { get; init; } + Action? OnRequestCompleted { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestPipelineFactory PipelineProvider { get; init; } + bool PrettyJson { get; init; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; init; } + string? ProxyPassword { get; init; } + string? ProxyUsername { get; init; } + NameValueCollection? QueryStringParameters { get; init; } + IRequestInvoker RequestInvoker { get; } + RequestMetaData? RequestMetaData { get; init; } + Serializer RequestResponseSerializer { get; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + Func? ServerCertificateValidationCallback { get; init; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; init; } + TimeSpan? SniffInformationLifeSpan { get; init; } + bool SniffsOnConnectionFault { get; init; } + bool SniffsOnStartup { get; init; } + Func StatusCodeToResponseSuccess { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UrlFormatter UrlFormatter { get; init; } + UserAgent UserAgent { get; init; } + virtual TransportConfiguration $() + void Dispose() + virtual bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(TransportConfiguration? left, TransportConfiguration? right) + static bool operator !=(TransportConfiguration? left, TransportConfiguration? right) + + class TransportConfigurationDescriptor : TransportConfigurationDescriptorBase + TransportConfigurationDescriptor(ITransportConfiguration config) + TransportConfigurationDescriptor(NodePool nodePool, IRequestInvoker? invoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(Uri? uri = null, ProductRegistration? productRegistration = null) + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + abstract class TransportConfigurationDescriptorBase : ITransportConfiguration, IRequestConfiguration, IDisposable where T : TransportConfigurationDescriptorBase + protected TransportConfigurationDescriptorBase(ITransportConfiguration config) + protected TransportConfigurationDescriptorBase(NodePool nodePool, IRequestInvoker? requestInvoker, Serializer? requestResponseSerializer, ProductRegistration? productRegistration) + protected Serializer UseThisRequestResponseSerializer { get; set; } + protected T Assign(TValue value, Action assigner) + T Authentication(AuthorizationHeader header) + T CertificateFingerprint(string fingerprint) + T ClientCertificate(X509Certificate certificate) + T ClientCertificate(string certificatePath) + T ClientCertificates(X509CertificateCollection certificates) + T ConnectionLimit(int connectionLimit) + T DeadTimeout(TimeSpan timeout) + T DisableAuditTrail(bool b = true) + T DisableAutomaticProxyDetection(bool disable = true) + T DisableDirectStreaming(bool b = true) + T DisableMetaHeader(bool disable = true) + T DisablePing(bool disable = true) + protected virtual void DisposeManagedResources() + T DnsRefreshTimeout(TimeSpan timeout) + virtual T EnableDebugMode(Action? onRequestCompleted = null) + T EnableHttpCompression(bool enabled = true) + T EnableHttpPipelining(bool enabled = true) + T EnableTcpKeepAlive(TimeSpan keepAliveTime, TimeSpan keepAliveInterval) + T EnableTcpStats(bool enableTcpStats = true) + T EnableThreadPoolStats(bool enableThreadPoolStats = true) + T GlobalHeaders(NameValueCollection headers) + T GlobalQueryStringParameters(NameValueCollection queryStringParameters) + T MaxDeadTimeout(TimeSpan timeout) + T MaxRetryTimeout(TimeSpan maxRetryTimeout) + T MaximumRetries(int maxRetries) + T MemoryStreamFactory(MemoryStreamFactory memoryStreamFactory) + T NodePredicate(Func predicate) + T OnBoundConfigurationCreated(Action handler) + T OnRequestCompleted(Action handler) + virtual T ParseAllHeaders(bool b = true) + T PingTimeout(TimeSpan timeout) + T PipelineProvider(RequestPipelineFactory provider) + virtual T PrettyJson(bool b = true) + T Proxy(Uri proxyAddress, string username, string password) + T Proxy(Uri proxyAddress) + T RequestTimeout(TimeSpan timeout) + T ResponseBuilder(IResponseBuilder responseBuilder) + virtual T ResponseHeadersToParse(HeadersList headersToParse) + T ServerCertificateValidationCallback(Func callback) + T SkipDeserializationForStatusCodes(params int[] statusCodes) + T SniffLifeSpan(TimeSpan? sniffLifeSpan) + T SniffOnConnectionFault(bool sniffsOnConnectionFault = true) + T SniffOnStartup(bool sniffsOnStartup = true) + T ThrowExceptions(bool alwaysThrow = true) + T TransferEncodingChunked(bool transferEncodingChunked = true) + protected T UpdateGlobalQueryString(string key, string value, bool enabled) + T UserAgent(UserAgent userAgent) + + class TransportException : Exception + TransportException(PipelineFailure failure, string message, TransportResponse response) + TransportException(PipelineFailure failure, string message, Exception? innerException = null) + TransportException(string message) + ApiCallDetails? ApiCallDetails { get; } + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + Endpoint? Endpoint { get; } + PipelineFailure? FailureReason { get; } + + static class TransportExtensions + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData, IRequestConfiguration configuration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + static class TransportHttpMethodExtensions + static TResponse Delete(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default) where TResponse : TransportResponse, new() + static TResponse Delete(this ITransport transport, string path, RequestParameters parameters, PostData? data = null) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string path, RequestParameters parameters, PostData? data = null, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string pathAndQuery) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string path, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static VoidResponse Head(this ITransport transport, string pathAndQuery, TimeSpan timeout) + static VoidResponse Head(this ITransport transport, string pathAndQuery) + static VoidResponse Head(this ITransport transport, string path, RequestParameters parameters) + static Task HeadAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string pathAndQuery, TimeSpan timeout, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + abstract class TransportResponse + protected TransportResponse() + [JsonIgnore] + ApiCallDetails ApiCallDetails { get; } + [JsonIgnore] + protected internal virtual bool LeaveOpen { get; } + [JsonIgnore] + protected internal IEnumerable? LinkedDisposables { get; } + override string ToString() + + abstract class TransportResponse : TransportResponse + protected TransportResponse() + T Body { get; protected internal set; } + + class TransportSerializerOptionsProvider : IJsonSerializerOptionsProvider + TransportSerializerOptionsProvider() + TransportSerializerOptionsProvider(IReadOnlyCollection bakedInConverters, IReadOnlyCollection? userProvidedConverters, Action? mutateOptions = null) + JsonSerializerOptions CreateJsonSerializerOptions() + + abstract class TypedResponseBuilder : IResponseBuilder + protected TypedResponseBuilder() + protected abstract TResponse Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) + protected abstract Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) + + class UnexpectedTransportException : TransportException + UnexpectedTransportException(Exception killerException, IReadOnlyCollection? seenExceptions) + IReadOnlyCollection SeenExceptions { get; } + + sealed class UrlFormatter : IFormatProvider, ICustomFormatter + UrlFormatter(ITransportConfiguration settings) + static string CreateString(object? value, ITransportConfiguration settings) + string CreateString(object? value) + string Format(string? format, object? arg, IFormatProvider? formatProvider) + object? GetFormat(Type? formatType) + + sealed class UserAgent + static UserAgent Create(string reposName, Type typeVersionLookup, string[] metadata) + static UserAgent Create(string reposName, Type typeVersionLookup) + static UserAgent Create(string fullUserAgentString) + override string ToString() + + abstract class VersionInfo + protected VersionInfo(SemVersion version) + bool IsPrerelease { get; } + int Major { get; } + string? Metadata { get; } + int Minor { get; } + int Patch { get; } + string? Prerelease { get; } + string ToMetadataHeaderValue() + override string ToString() + + sealed class VoidResponse : TransportResponse + VoidResponse() + static VoidResponse Default { get; } + class VoidBody + VoidBody() + +namespace Elastic.Transport.Diagnostics + static class OpenTelemetry + const string ElasticTransportActivitySourceName = "Elastic.Transport" + static bool ElasticTransportActivitySourceHasListeners { get; } + + class ThreadPoolStatistics + ThreadPoolStatistics(int min, int max, int busy, int free) + int Busy { get; } + int Free { get; } + int Max { get; } + int Min { get; } + + static class ThreadPoolStats + static ReadOnlyDictionary GetStats() + + abstract class TypedDiagnosticObserver : IObserver> + protected TypedDiagnosticObserver(Action> onNextStart, Action> onNextEnd, Action? onError = null, Action? onCompleted = null) + +namespace Elastic.Transport.Diagnostics.Auditing + sealed class Audit + DateTimeOffset Ended { get; } + AuditEvent Event { get; } + Exception? Exception { get; } + Node? Node { get; } + DateTimeOffset Started { get; } + override string ToString() + + enum AuditEvent + SniffOnStartup = 0 + SniffOnFail = 1 + SniffOnStaleCluster = 2 + SniffSuccess = 3 + SniffFailure = 4 + PingSuccess = 5 + PingFailure = 6 + Resurrection = 7 + AllNodesDead = 8 + BadResponse = 9 + HealthyResponse = 10 + MaxTimeoutReached = 11 + MaxRetriesReached = 12 + BadRequest = 13 + NoNodesAttempted = 14 + CancellationRequested = 15 + FailedOverAllNodes = 16 + + class Auditor : IReadOnlyCollection, IEnumerable, IEnumerable + int Count { get; } + void Emit(AuditEvent type, Node node) + void Emit(AuditEvent type) + IEnumerator GetEnumerator() + +namespace Elastic.Transport.Extensions + sealed class SemVersion : IEquatable, IComparable, IComparable + SemVersion(int major, int minor, int patch, string? prerelease, string? metadata) + SemVersion(int major, int minor, int patch, string? prerelease) + SemVersion(int major, int minor, int patch) + int Major { get; } + string Metadata { get; } + int Minor { get; } + int Patch { get; } + string Prerelease { get; } + int CompareByPrecedence(SemVersion? other) + int CompareTo(SemVersion? other) + int CompareTo(object? obj) + bool Equals(SemVersion? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool TryParse(string input, [NotNullWhen(true)] out SemVersion? version) + SemVersion Update(int? major = default, int? minor = default, int? patch = default, string? prerelease = null, string? metadata = null) + static bool operator ==(SemVersion left, SemVersion right) + static bool operator >(SemVersion left, SemVersion right) + static bool operator >=(SemVersion left, SemVersion right) + static bool operator !=(SemVersion left, SemVersion right) + static bool operator <(SemVersion left, SemVersion right) + static bool operator <=(SemVersion left, SemVersion right) + + static class TransportSerializerExtensions + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, string input, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, string input, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, JsonElement node, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, JsonElement node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, JsonNode node, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, JsonNode node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static byte[] SerializeToBytes(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static string SerializeToString(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static string SerializeToString(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static bool TryGetJsonSerializerOptions(this Serializer serializer, [NotNullWhen(true)] out JsonSerializerOptions? options, SerializationFormatting formatting = SerializationFormatting.None) + +namespace Elastic.Transport.Products + sealed class DefaultProductRegistration : ProductRegistration + DefaultProductRegistration() + static DefaultProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override HeadersList ResponseHeadersToParse { get; } + override string? ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ProductRegistration + protected ProductRegistration() + abstract string? DefaultContentType { get; } + abstract IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + abstract MetaHeaderProvider MetaHeaderProvider { get; } + abstract string Name { get; } + abstract string ProductAssemblyVersion { get; } + virtual IReadOnlyCollection ResponseBuilders { get; } + abstract HeadersList ResponseHeadersToParse { get; } + abstract string? ServiceIdentifier { get; } + abstract bool SupportsPing { get; } + abstract bool SupportsSniff { get; } + abstract Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + abstract Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + abstract IReadOnlyCollection DefaultHeadersToParse() + abstract bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + virtual bool IsErrorContentType(string? contentType) + virtual bool IsExpectedResponseContentType(string accept, string? responseContentType) + virtual bool IsJsonContentType(string? contentType) + virtual bool IsValidResponse(ApiCallDetails? details) + abstract bool NodePredicate(Node node) + abstract Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + abstract TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract int SniffOrder(Node node) + virtual string? TransformContentType(string? contentType) + virtual ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + abstract bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + +namespace Elastic.Transport.Products.Elasticsearch + record ElasticsearchConfiguration : TransportConfiguration, IEquatable + protected ElasticsearchConfiguration(ElasticsearchConfiguration original) + ElasticsearchConfiguration(string cloudId, ApiKey credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, ApiKey credentials) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, ApiKey credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri? uri = null) + protected override Type EqualityContract { get; } + override ElasticsearchConfiguration $() + virtual bool Equals(ElasticsearchConfiguration? other) + sealed override bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected override bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + static bool operator !=(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + + sealed class ElasticsearchDynamicResponse : DynamicResponseBase, IElasticsearchResponse + ElasticsearchDynamicResponse() + ElasticsearchDynamicResponse(DynamicDictionary dictionary) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchErrorExtensions + static bool TryGetElasticsearchServerError(this BytesResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this StringResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this TransportResponse response, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchJsonResponse : JsonResponseBase, IElasticsearchResponse + ElasticsearchJsonResponse() + ElasticsearchJsonResponse(JsonNode node) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchNodeFeatures + static readonly IReadOnlyCollection Default + const string HoldsData = "node.data" + const string HttpEnabled = "node.http" + const string IngestEnabled = "node.ingest" + const string MasterEligible = "node.master" + static readonly IReadOnlyCollection MasterEligibleOnly + static readonly IReadOnlyCollection NotMasterEligible + + sealed class ElasticsearchPipeResponse : PipeResponseBase, IElasticsearchResponse + ElasticsearchPipeResponse() + ElasticsearchPipeResponse(Stream responseStream, string? contentType) + PipeReader Body { get; } + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + class ElasticsearchProductRegistration : ProductRegistration + ElasticsearchProductRegistration(Type markerType) + const string SniffPath = "_nodes/http,settings" + static ProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override IReadOnlyCollection ResponseBuilders { get; } + override HeadersList ResponseHeadersToParse { get; } + sealed override string ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool IsErrorContentType(string? contentType) + override bool IsExpectedResponseContentType(string accept, string? responseContentType) + override bool IsJsonContentType(string? contentType) + override bool IsValidResponse(ApiCallDetails? details) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override string? TransformContentType(string? contentType) + override ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ElasticsearchResponse : TransportResponse, IElasticsearchResponse + protected ElasticsearchResponse() + [JsonIgnore] + string DebugInformation { get; } + [JsonIgnore] + ElasticsearchServerError? ElasticsearchServerError { get; } + [JsonIgnore] + IEnumerable ElasticsearchWarnings { get; } + [JsonIgnore] + virtual bool IsValidResponse { get; } + protected virtual void DebugIsValid(StringBuilder sb) + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ElasticsearchServerError : ErrorResponse + ElasticsearchServerError() + ElasticsearchServerError(Error error, int? statusCode) + [DataMember(Name = "error")] + [JsonPropertyName("error")] + Error? Error { get; init; } + [DataMember(Name = "status")] + [JsonPropertyName("status")] + int Status { get; init; } + static ElasticsearchServerError Create(Stream stream) + static ValueTask CreateAsync(Stream stream, CancellationToken token = default) + override bool HasError() + override string ToString() + static bool TryCreate(Stream stream, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchStreamResponse : StreamResponseBase, IElasticsearchResponse + ElasticsearchStreamResponse() + ElasticsearchStreamResponse(Stream body, string? contentType) + Stream Body { get; } + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + sealed class ElasticsearchStringResponse : StringResponseBase, IElasticsearchResponse + ElasticsearchStringResponse() + ElasticsearchStringResponse(string body) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.15.2326")] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ErrorCause))] + [JsonSerializable(typeof(System.Collections.Generic.Dictionary`2[[System.String, System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Object, System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Collections, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyCollection`1[Elastic.Transport.Products.Elasticsearch.ErrorCause], System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyDictionary`2[[System.String, System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.String, System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.Object[], System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.String))] + [JsonSerializable(typeof(System.Text.Json.JsonElement))] + [JsonSourceGenerationOptions(GenerationMode = (JsonSourceGenerationMode)0, UseStringEnumConverter = true)] + class ElasticsearchTransportSerializerContext : JsonSerializerContext, IJsonTypeInfoResolver + ElasticsearchTransportSerializerContext() + ElasticsearchTransportSerializerContext(JsonSerializerOptions options) + static ElasticsearchTransportSerializerContext Default { get; } + JsonTypeInfo> DictionaryStringObject { get; } + JsonTypeInfo ElasticsearchResponse { get; } + JsonTypeInfo ElasticsearchServerError { get; } + JsonTypeInfo Error { get; } + JsonTypeInfo ErrorCause { get; } + protected override JsonSerializerOptions? GeneratedSerializerOptions { get; } + JsonTypeInfo> IReadOnlyCollectionErrorCause { get; } + JsonTypeInfo> IReadOnlyDictionaryStringString { get; } + JsonTypeInfo Int32 { get; } + JsonTypeInfo JsonElement { get; } + JsonTypeInfo Object { get; } + JsonTypeInfo ObjectArray { get; } + JsonTypeInfo String { get; } + override JsonTypeInfo? GetTypeInfo(Type type) + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.Products.Elasticsearch.ErrorConverter))] + sealed class Error : ErrorCause + Error() + [JsonPropertyName("headers")] + IReadOnlyDictionary Headers { get; set; } + [JsonPropertyName("root_cause")] + IReadOnlyCollection? RootCause { get; set; } + override string ToString() + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.ErrorCauseConverter))] + class ErrorCause + ErrorCause() + IReadOnlyDictionary AdditionalProperties { get; } + ErrorCause? CausedBy { get; } + string? Index { get; } + string? IndexUUID { get; } + string? Reason { get; } + [JsonPropertyName("stack_trace")] + string? StackTrace { get; } + string? Type { get; } + override string ToString() + + sealed class ErrorConverter : JsonConverter + ErrorConverter() + override Error? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + override void Write(Utf8JsonWriter writer, Error value, JsonSerializerOptions options) + + interface IElasticsearchResponse + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ShardFailure + ShardFailure() + [JsonPropertyName("index")] + string? Index { get; set; } + [JsonPropertyName("node")] + string? Node { get; set; } + [JsonPropertyName("reason")] + ErrorCause? Reason { get; set; } + [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] + [JsonPropertyName("shard")] + int? Shard { get; set; } + [JsonPropertyName("status")] + string? Status { get; set; } + + static class SniffParser + static Regex AddressRegex { get; } + static Uri ParseToUri(string boundAddress, bool forceHttp) diff --git a/api/Elastic.Transport.net462.api b/api/Elastic.Transport.net462.api new file mode 100644 index 00000000..cd22127e --- /dev/null +++ b/api/Elastic.Transport.net462.api @@ -0,0 +1,1495 @@ +assembly Elastic.Transport +using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri +using struct System: DateTime, DateTimeOffset, Guid, ReadOnlySpan<>, TimeSpan, TypeCode +using interface System: IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> +using System.CodeDom.Compiler: GeneratedCodeAttribute +using interface System.Collections: IEnumerable +using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> +using struct System.Collections.Generic: KeyValuePair<,> +using interface System.Collections.Generic: ICollection<>, IDictionary<,>, IEnumerable<>, IReadOnlyCollection<> +using System.Collections.ObjectModel: ReadOnlyDictionary<,> +using System.Collections.Specialized: NameValueCollection +using System.ComponentModel: BrowsableAttribute, EditorBrowsableAttribute +using System.Diagnostics: Activity +using System.Diagnostics.CodeAnalysis: NotNullWhenAttribute +using System.Dynamic: BinaryOperationBinder, ConvertBinder, DynamicObject, GetMemberBinder, SetMemberBinder +using System.IO: MemoryStream, Stream +using System.Linq: IOrderedEnumerable<> +using System.Net: HttpWebRequest, ServicePoint +using struct System.Net.NetworkInformation: TcpState +using struct System.Net.Security: SslPolicyErrors +using System.Runtime.Serialization: DataContractAttribute, DataMemberAttribute, EnumMemberAttribute +using System.Security.Cryptography.X509Certificates: X509Certificate, X509CertificateCollection, X509Chain +using struct System.Security.Cryptography.X509Certificates: X509RevocationMode +using System.Text: StringBuilder +using System.Text.Json: JsonSerializerOptions, Utf8JsonWriter +using struct System.Text.Json: JsonElement, Utf8JsonReader +using System.Text.Json.Nodes: JsonNode +using System.Text.Json.Serialization: JsonConverter, JsonConverter<>, JsonConverterAttribute, JsonIgnoreAttribute, JsonNumberHandlingAttribute, JsonPropertyNameAttribute, JsonSerializableAttribute, JsonSerializerContext, JsonSourceGenerationOptionsAttribute +using System.Text.Json.Serialization.Metadata: JsonTypeInfo, JsonTypeInfo<> +using interface System.Text.Json.Serialization.Metadata: IJsonTypeInfoResolver +using System.Text.RegularExpressions: Regex +using System.Threading: SemaphoreSlim +using struct System.Threading: CancellationToken +using System.Threading.Tasks: Task, Task<> +using struct System.Threading.Tasks: ValueTask<> + +namespace Elastic.Transport + sealed class ApiCallDetails + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + bool HasExpectedContentType { get; } + bool HasSuccessfulStatusCode { get; } + HttpMethod HttpMethod { get; } + int? HttpStatusCode { get; } + Exception? OriginalException { get; } + ErrorResponse? ProductError { get; } + byte[]? RequestBodyInBytes { get; } + byte[]? ResponseBodyInBytes { get; } + string ResponseContentType { get; set; } + [Obsolete("This property has been retired and replaced by ResponseContentType. Prefer using the updated property as this will be removed in a future release.")] + string ResponseMimeType { get; set; } + Uri? Uri { get; } + override string ToString() + bool TryGetHeader(string key, [NotNullWhen(true)] out IEnumerable? headerValues) + + class ApiKey : AuthorizationHeader + ApiKey(string apiKey) + override string AuthScheme { get; } + override bool TryGetAuthorizationParameters(out string value) + + abstract class AuthorizationHeader + protected AuthorizationHeader() + abstract string AuthScheme { get; } + abstract bool TryGetAuthorizationParameters(out string value) + + class Base64ApiKey : ApiKey + Base64ApiKey(string id, string apiKey) + Base64ApiKey(string base64EncodedApiKey) + + sealed class BasicAuthentication : AuthorizationHeader + BasicAuthentication(string username, string password) + override string AuthScheme { get; } + static string BasicAuthenticationScheme { get; } + static string GetBase64String(string header) + override bool TryGetAuthorizationParameters(out string value) + + sealed record BoundConfiguration : IRequestConfiguration, IEquatable + BoundConfiguration(ITransportConfiguration global, IRequestConfiguration? local = null) + const string DefaultContentType = "application/json" + const string RunAsSecurityHeader = "es-security-runas-user" + string Accept { get; } + IReadOnlyCollection AllowedStatusCodes { get; } + AuthorizationHeader? AuthenticationHeader { get; } + X509CertificateCollection? ClientCertificates { get; } + ITransportConfiguration ConnectionSettings { get; } + string ContentType { get; } + bool DisableAuditTrail { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableDirectStreaming { get; } + bool DisablePings { get; } + bool DisableSniff { get; } + TimeSpan DnsRefreshTimeout { get; } + bool EnableTcpStats { get; } + bool EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool HttpCompression { get; } + bool HttpPipeliningEnabled { get; } + int KeepAliveInterval { get; } + int KeepAliveTime { get; } + int MaxRetries { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + string? OpaqueId { get; } + bool ParseAllHeaders { get; } + TimeSpan PingTimeout { get; } + IReadOnlyCollection ProductResponseBuilders { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + IReadOnlyCollection SkipDeserializationForStatusCodes { get; } + bool ThrowExceptions { get; } + bool TransferEncodingChunked { get; } + UserAgent UserAgent { get; } + BoundConfiguration $() + static BoundConfiguration Create(ITransport transport, IRequestConfiguration requestConfiguration) + bool Equals(BoundConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool operator ==(BoundConfiguration? left, BoundConfiguration? right) + static bool operator !=(BoundConfiguration? left, BoundConfiguration? right) + + sealed class BytesResponse : TransportResponse + BytesResponse() + BytesResponse(byte[] body) + + static class CertificateValidations + static bool AllowAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + static Func AuthorityIsRoot(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static Func AuthorityPartOfChain(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static bool DenyAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + + sealed class CloudNodePool : SingleNodePool + CloudNodePool(string cloudId, AuthorizationHeader credentials, CloudService service) + CloudNodePool(string cloudId, AuthorizationHeader credentials) + CloudNodePool(Uri cloudEndpoint, AuthorizationHeader credentials) + AuthorizationHeader AuthenticationHeader { get; } + + enum CloudService + Elasticsearch = 0 + Kibana = 1 + + abstract class DateTimeProvider + abstract DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + abstract DateTimeOffset Now() + + sealed class DefaultDateTimeProvider : DateTimeProvider + DefaultDateTimeProvider() + static readonly DefaultDateTimeProvider Default + override DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + override DateTimeOffset Now() + + sealed class DefaultMemoryStreamFactory : MemoryStreamFactory + DefaultMemoryStreamFactory() + static DefaultMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class DefaultMetaHeaderProducer : MetaHeaderProducer + DefaultMetaHeaderProducer(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProducer(Type clientType, string serviceIdentifier) + override string HeaderName { get; } + override string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + sealed class DefaultMetaHeaderProvider : MetaHeaderProvider + DefaultMetaHeaderProvider(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProvider(Type clientType, string serviceIdentifier) + override MetaHeaderProducer[] Producers { get; } + + sealed class DefaultRequestParameters : RequestParameters + DefaultRequestParameters() + + sealed class DistributedTransport : DistributedTransport + DistributedTransport(ITransportConfiguration configuration) + + class DistributedTransport : ITransport, ITransport where TConfiguration : class, ITransportConfiguration + DistributedTransport(TConfiguration configuration) + TConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + sealed class DynamicDictionary : DynamicObject, IEquatable, IDictionary, ICollection>, IEnumerable>, IEnumerable + DynamicDictionary() + int Count { get; } + static DynamicDictionary Empty { get; } + bool IsReadOnly { get; } + DynamicValue this[string name] { get; set; } + ICollection Keys { get; } + ICollection Values { get; } + void Add(KeyValuePair item) + void Add(string key, DynamicValue value) + void Clear() + bool Contains(KeyValuePair item) + bool ContainsKey(string key) + void CopyTo(KeyValuePair[] array, int arrayIndex) + static DynamicDictionary Create(IDictionary values) + static DynamicDictionary Create(JsonElement e) + bool Equals(DynamicDictionary? other) + override bool Equals(object? obj) + T Get(string? path) + override IEnumerable GetDynamicMemberNames() + override int GetHashCode() + bool Remove(KeyValuePair item) + bool Remove(string key) + Dictionary ToDictionary() + override bool TryGetMember(GetMemberBinder binder, out object result) + bool TryGetValue(string key, out DynamicValue value) + override bool TrySetMember(SetMemberBinder binder, object? value) + + sealed class DynamicResponse : DynamicResponseBase + DynamicResponse() + DynamicResponse(DynamicDictionary dictionary) + + abstract class DynamicResponseBase : TransportResponse + protected DynamicResponseBase() + protected DynamicResponseBase(DynamicDictionary dictionary) + T Get(string path) + + sealed class DynamicValue : DynamicObject, IEquatable, IConvertible, IReadOnlyCollection, IEnumerable, IEnumerable + DynamicValue(object? value) + int Count { get; } + bool HasValue { get; } + DynamicValue this[int i] { get; } + DynamicValue this[string name] { get; } + static DynamicValue NullValue { get; } + object? Value { get; } + static object? ConsumeJsonElement(Type targetReturnType, JsonElement e) + T? Default(T? defaultValue = null) + bool Equals(DynamicValue? compareValue) + override bool Equals(object? obj) + T? Get(string path) + IEnumerator GetEnumerator() + override int GetHashCode() + TypeCode GetTypeCode() + static DynamicValue SelfOrNew(object v) + bool ToBoolean(IFormatProvider? provider) + byte ToByte(IFormatProvider? provider) + char ToChar(IFormatProvider? provider) + DateTime ToDateTime(IFormatProvider? provider) + decimal ToDecimal(IFormatProvider? provider) + IDictionary? ToDictionary() + double ToDouble(IFormatProvider? provider) + IEnumerable ToEnumerable() + short ToInt16(IFormatProvider? provider) + int ToInt32(IFormatProvider? provider) + long ToInt64(IFormatProvider? provider) + [CLSCompliant(false)] + sbyte ToSByte(IFormatProvider? provider) + float ToSingle(IFormatProvider? provider) + override string? ToString() + string ToString(IFormatProvider? provider) + object ToType(Type conversionType, IFormatProvider? provider) + [CLSCompliant(false)] + ushort ToUInt16(IFormatProvider? provider) + [CLSCompliant(false)] + uint ToUInt32(IFormatProvider? provider) + [CLSCompliant(false)] + ulong ToUInt64(IFormatProvider? provider) + override bool TryBinaryOperation(BinaryOperationBinder binder, object arg, out object? result) + override bool TryConvert(ConvertBinder binder, out object? result) + override bool TryGetMember(GetMemberBinder binder, out object? result) + T? TryParse(T? defaultValue = null) + static bool operator ==(DynamicValue dynamicValue, object compareValue) + static bool operator !=(DynamicValue dynamicValue, object compareValue) + static implicit operator bool(DynamicValue dynamicValue) + static implicit operator string?(DynamicValue dynamicValue) + static implicit operator int(DynamicValue dynamicValue) + static implicit operator Guid(DynamicValue dynamicValue) + static implicit operator DateTime(DynamicValue dynamicValue) + static implicit operator DateTimeOffset(DynamicValue dynamicValue) + static implicit operator TimeSpan(DynamicValue dynamicValue) + static implicit operator long(DynamicValue dynamicValue) + static implicit operator float(DynamicValue dynamicValue) + static implicit operator decimal(DynamicValue dynamicValue) + static implicit operator double(DynamicValue dynamicValue) + + record Endpoint : IEquatable + Endpoint(in EndpointPath Path, Node Node) + protected Endpoint(Endpoint original) + protected virtual Type EqualityContract { get; } + bool IsEmpty { get; } + HttpMethod Method { get; } + Node Node { get; init; } + EndpointPath Path { get; init; } + string PathAndQuery { get; } + Uri Uri { get; } + virtual Endpoint $() + void Deconstruct(out EndpointPath Path, out Node Node) + static Endpoint Empty(in EndpointPath path) + virtual bool Equals(Endpoint? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(Endpoint? left, Endpoint? right) + static bool operator !=(Endpoint? left, Endpoint? right) + + readonly struct EndpointPath : IEquatable + EndpointPath(HttpMethod Method, string PathAndQuery) + HttpMethod Method { get; init; } + string PathAndQuery { get; init; } + void Deconstruct(out HttpMethod Method, out string PathAndQuery) + bool Equals(EndpointPath other) + override bool Equals(object obj) + override int GetHashCode() + override string ToString() + static bool operator ==(EndpointPath left, EndpointPath right) + static bool operator !=(EndpointPath left, EndpointPath right) + + class ErrorCauseConverter : ErrorCauseConverter + ErrorCauseConverter() + + abstract class ErrorCauseConverter : JsonConverter where TErrorCause : ErrorCause, new() + protected ErrorCauseConverter() + override TErrorCause? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + protected virtual bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, TErrorCause errorCause) + override void Write(Utf8JsonWriter writer, TErrorCause value, JsonSerializerOptions options) + + class ErrorConverter : ErrorCauseConverter + ErrorConverter() + protected override bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, Error errorCause) + + abstract class ErrorResponse + abstract bool HasError() + + readonly struct HeadersList : IEnumerable, IEnumerable + HeadersList(IEnumerable headers, IEnumerable otherHeaders) + HeadersList(IEnumerable headers, string additionalHeader) + HeadersList(IEnumerable headers) + HeadersList(HeadersList? headers, HeadersList? otherHeaders) + HeadersList(string header) + int Count { get; } + IEnumerator GetEnumerator() + + enum HttpMethod + [EnumMember(Value = "GET")] + GET = 0 + [EnumMember(Value = "POST")] + POST = 1 + [EnumMember(Value = "PUT")] + PUT = 2 + [EnumMember(Value = "DELETE")] + DELETE = 3 + [EnumMember(Value = "HEAD")] + HEAD = 4 + + static class HttpMethodExtensions + static string GetStringValue(this HttpMethod httpMethod) + + class HttpRequestInvoker : HttpWebRequestInvoker + HttpRequestInvoker() + + class HttpWebRequestInvoker : IRequestInvoker, IDisposable + HttpWebRequestInvoker() + ResponseFactory ResponseFactory { get; } + protected virtual void AlterServicePoint(ServicePoint requestServicePoint, BoundConfiguration boundConfiguration) + protected virtual HttpWebRequest CreateHttpWebRequest(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, bool isAsync) + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected virtual void SetAuthenticationIfNeeded(Endpoint endpoint, BoundConfiguration boundConfiguration, HttpWebRequest request) + protected virtual void SetClientCertificates(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetProxyIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetServerCertificateValidationCallBackIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + + interface IJsonSerializerOptionsProvider + JsonSerializerOptions CreateJsonSerializerOptions() + + interface IRequestConfiguration + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; } + AuthorizationHeader? Authentication { get; } + X509CertificateCollection? ClientCertificates { get; } + string? ContentType { get; } + bool? DisableAuditTrail { get; } + bool? DisableDirectStreaming { get; } + bool? DisablePings { get; } + bool? DisableSniff { get; } + bool? EnableHttpCompression { get; } + bool? EnableTcpStats { get; } + bool? EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool? HttpPipeliningEnabled { get; } + int? MaxRetries { get; } + TimeSpan? MaxRetryTimeout { get; } + string? OpaqueId { get; } + bool? ParseAllHeaders { get; } + TimeSpan? PingTimeout { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan? RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + bool? ThrowExceptions { get; } + bool? TransferEncodingChunked { get; } + UserAgent? UserAgent { get; } + + interface IRequestInvoker : IDisposable + ResponseFactory ResponseFactory { get; } + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + interface IResponseBuilder + TResponse? Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) where TResponse : TransportResponse, new() + Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + bool CanBuild() where TResponse : TransportResponse, new() + + interface IStringable + string GetString() + + interface ITransport + ITransportConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + interface ITransportConfiguration : IRequestConfiguration, IDisposable + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; } + int ConnectionLimit { get; } + DateTimeProvider? DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableMetaHeader { get; } + TimeSpan DnsRefreshTimeout { get; } + TimeSpan? KeepAliveInterval { get; } + TimeSpan? KeepAliveTime { get; } + TimeSpan? MaxDeadTimeout { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + NodePool NodePool { get; } + Func? NodePredicate { get; } + Action? OnConfigurationBound { get; } + Action? OnRequestCompleted { get; } + RequestPipelineFactory? PipelineProvider { get; } + bool PrettyJson { get; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + NameValueCollection? QueryStringParameters { get; } + IRequestInvoker RequestInvoker { get; } + Serializer RequestResponseSerializer { get; } + Func? ServerCertificateValidationCallback { get; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; } + TimeSpan? SniffInformationLifeSpan { get; } + bool SniffsOnConnectionFault { get; } + bool SniffsOnStartup { get; } + Func StatusCodeToResponseSuccess { get; } + UrlFormatter UrlFormatter { get; } + + interface ITransport : ITransport where TConfiguration : class, ITransportConfiguration + TConfiguration Configuration { get; } + + interface IUrlParameter + string GetString(ITransportConfiguration settings) + + class InMemoryRequestInvoker : IRequestInvoker, IDisposable + InMemoryRequestInvoker() + InMemoryRequestInvoker(byte[]? responseBody, int statusCode = 200, Exception? exception = null, string contentType = "application/json", Dictionary>? headers = null) + ResponseFactory ResponseFactory { get; } + TResponse BuildResponse(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + Task BuildResponseAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + sealed class JsonResponse : JsonResponseBase + JsonResponse() + JsonResponse(JsonNode node) + + abstract class JsonResponseBase : TransportResponse + protected JsonResponseBase() + protected JsonResponseBase(JsonNode node) + T Get(string path) + + abstract class MemoryStreamFactory + protected MemoryStreamFactory() + abstract MemoryStream Create() + abstract MemoryStream Create(byte[] bytes, int index, int count) + abstract MemoryStream Create(byte[] bytes) + + sealed class MetaDataHeader + MetaDataHeader(VersionInfo version, string serviceIdentifier, bool isAsync) + string ClientVersion { get; } + string RuntimeVersion { get; } + string ServiceIdentifier { get; } + string? TransportVersion { get; } + override string ToString() + + abstract class MetaHeaderProducer + protected MetaHeaderProducer() + abstract string HeaderName { get; } + abstract string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + abstract class MetaHeaderProvider + protected MetaHeaderProvider() + abstract MetaHeaderProducer[] Producers { get; } + + sealed class Node : IEquatable + Node(Uri uri, IEnumerable? features = null) + DateTimeOffset DeadUntil { get; } + int FailedAttempts { get; } + IReadOnlyCollection Features { get; set; } + string? Id { get; } + bool IsAlive { get; } + bool IsResurrected { get; set; } + string? Name { get; set; } + IReadOnlyDictionary Settings { get; set; } + Uri Uri { get; } + Node Clone() + Uri CreatePath(string path) + bool Equals(Node? other) + override bool Equals(object? obj) + override int GetHashCode() + bool HasFeature(string feature) + void MarkAlive() + void MarkDead(DateTimeOffset until) + static bool operator ==(Node left, Node right) + static bool operator !=(Node left, Node right) + static implicit operator Node(Uri uri) + + abstract class NodePool : IDisposable + protected NodePool() + DateTimeProvider DateTimeProvider { get; set; } + abstract DateTimeOffset? LastUpdate { get; protected set; } + abstract int MaxRetries { get; } + abstract IReadOnlyCollection Nodes { get; } + bool SniffedOnStartup { get; } + abstract bool SupportsPinging { get; } + abstract bool SupportsReseeding { get; } + bool UsingSsl { get; protected set; } + abstract IEnumerable CreateView(Auditor? auditor = null) + void Dispose() + protected virtual void Dispose(bool disposing) + void MarkAsSniffed() + abstract void Reseed(IEnumerable nodes) + + class PipelineException : Exception + PipelineException(PipelineFailure failure, Exception? innerException) + PipelineException(PipelineFailure failure) + PipelineFailure FailureReason { get; } + bool Recoverable { get; } + TransportResponse? Response { get; } + + enum PipelineFailure + BadAuthentication = 0 + BadResponse = 1 + PingFailure = 2 + SniffFailure = 3 + CouldNotStartSniffOnStartup = 4 + MaxTimeoutReached = 5 + MaxRetriesReached = 6 + Unexpected = 7 + BadRequest = 8 + NoNodesAttempted = 9 + + abstract class PostData + protected PostData() + protected const int BufferSize = 81920 + protected static readonly byte[] NewLineByteArray + static PostData Empty { get; } + PostType Type { get; } + byte[]? WrittenBytes { get; } + protected void BufferIfNeeded(MemoryStreamFactory memoryStreamFactory, bool disableDirectStreaming, ref MemoryStream? buffer, ref Stream stream) + static PostData Bytes(byte[] bytes) + protected void FinishStream(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming) + protected Task FinishStreamAsync(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming, CancellationToken ctx) + static PostData MultiJson(IEnumerable listOfSerializables) + static PostData MultiJson(IEnumerable listOfString) + static PostData Serializable(T data) + static PostData StreamHandler(T state, Action syncWriter, Func asyncWriter) + static PostData String(string serializedString) + abstract void Write(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming) + abstract Task WriteAsync(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming, CancellationToken cancellationToken) + static implicit operator PostData(byte[] byteArray) + static implicit operator PostData(string literalString) + + enum PostType + ByteArray = 0 + LiteralString = 1 + Serializable = 2 + EnumerableOfString = 3 + EnumerableOfObject = 4 + StreamHandler = 5 + + sealed class RecyclableMemoryStreamFactory : MemoryStreamFactory + RecyclableMemoryStreamFactory() + static RecyclableMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class ReflectionVersionInfo : VersionInfo + static readonly string TransportVersion + static ReflectionVersionInfo Create() + static ReflectionVersionInfo Create(Type type) + + record RequestConfiguration : IRequestConfiguration, IEquatable + RequestConfiguration() + RequestConfiguration(IRequestConfiguration config) + protected RequestConfiguration(RequestConfiguration original) + static readonly TimeSpan DefaultPingTimeout + static readonly TimeSpan DefaultPingTimeoutOnSsl + static readonly TimeSpan DefaultRequestTimeout + static readonly UserAgent DefaultUserAgent + string? Accept { get; init; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + string? ContentType { get; init; } + bool? DisableAuditTrail { get; init; } + bool? DisableDirectStreaming { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestMetaData? RequestMetaData { get; init; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UserAgent? UserAgent { get; init; } + virtual RequestConfiguration $() + virtual bool Equals(RequestConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(RequestConfiguration? left, RequestConfiguration? right) + static bool operator !=(RequestConfiguration? left, RequestConfiguration? right) + + class RequestConfigurationDescriptor : IRequestConfiguration + RequestConfigurationDescriptor() + RequestConfigurationDescriptor(IRequestConfiguration config) + RequestConfigurationDescriptor Accept(string acceptHeader) + RequestConfigurationDescriptor AllowedStatusCodes(IEnumerable? codes) + RequestConfigurationDescriptor AllowedStatusCodes(params int[] codes) + RequestConfigurationDescriptor Authentication(AuthorizationHeader authentication) + RequestConfigurationDescriptor ClientCertificate(X509Certificate certificate) + RequestConfigurationDescriptor ClientCertificate(string certificatePath) + RequestConfigurationDescriptor ClientCertificates(X509CertificateCollection certificates) + RequestConfigurationDescriptor ContentType(string contentTypeHeader) + RequestConfigurationDescriptor DisableAuditTrail(bool disable = true) + RequestConfigurationDescriptor DisableDirectStreaming(bool disable = true) + RequestConfigurationDescriptor DisablePing(bool disable = true) + RequestConfigurationDescriptor DisableSniffing(bool disable = true) + RequestConfigurationDescriptor EnableHttpCompression(bool enable = true) + RequestConfigurationDescriptor EnableHttpPipelining(bool enable = true) + RequestConfigurationDescriptor EnableTcpStats(bool enableTcpStats = true) + RequestConfigurationDescriptor EnableThreadPoolStats(bool enableThreadPoolStats = true) + RequestConfigurationDescriptor ForceNode(Uri uri) + RequestConfigurationDescriptor GlobalHeaders(NameValueCollection headers) + RequestConfigurationDescriptor MaxRetries(int retry) + RequestConfigurationDescriptor MaxRetries(TimeSpan? timeout) + RequestConfigurationDescriptor OpaqueId(string opaqueId) + RequestConfigurationDescriptor ParseAllHeaders(bool enable = true) + RequestConfigurationDescriptor PingTimeout(TimeSpan pingTimeout) + RequestConfigurationDescriptor RequestMetaData(RequestMetaData metaData) + RequestConfigurationDescriptor RequestTimeout(TimeSpan requestTimeout) + RequestConfigurationDescriptor ResponseBuilder(IResponseBuilder responseBuilder) + RequestConfigurationDescriptor ResponseHeadersToParse(IEnumerable headers) + RequestConfigurationDescriptor RunAs(string username) + RequestConfigurationDescriptor ThrowExceptions(bool throwExceptions = true) + RequestConfigurationDescriptor TransferEncodingChunked(bool transferEncodingChunked = true) + RequestConfigurationDescriptor UserAgent(UserAgent userAgent) + + sealed class RequestMetaData + RequestMetaData() + IReadOnlyDictionary? Items { get; } + + static class RequestMetaDataExtensions + static void AddHelper(this RequestMetaData metaData, string helperValue) + + abstract class RequestParameters + protected RequestParameters() + Dictionary QueryString { get; } + string? AcceptHeaderFromFormat(string? format) + bool ContainsQueryString(string name) + virtual string CreatePathWithQueryStrings(string? path, ITransportConfiguration? globalConfig) + TOut? GetQueryStringValue(string name) + protected void Q(string name, IStringable value) + protected void Q(string name, object value) + protected TOut? Q(string name) + void SetQueryString(string name, object? value) + + class RequestPipeline + void AuditCancellationRequested(Auditor? auditor) + void BadResponse(ref TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, TransportException exception, IReadOnlyCollection? auditTrail) where TResponse : TransportResponse, new() + TResponse CallProductEndpoint(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor) where TResponse : TransportResponse, new() + Task CallProductEndpointAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + TransportException? CreateClientException(TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, Auditor? auditor, DateTimeOffset startedOn, int attemptedNodes, List? seenExceptions) where TResponse : TransportResponse, new() + void FirstPoolUsage(SemaphoreSlim semaphore, Auditor? auditor) + Task FirstPoolUsageAsync(SemaphoreSlim semaphore, Auditor? auditor, CancellationToken cancellationToken) + void MarkAlive(Node node) + void MarkDead(Node node) + IEnumerable NextNode(DateTimeOffset startedOn, int attemptedNodes, Auditor? auditor) + void Ping(Node node, Auditor? auditor) + Task PingAsync(Node node, Auditor? auditor, CancellationToken cancellationToken = default) + void Sniff(Auditor? auditor) + Task SniffAsync(Auditor? auditor, CancellationToken cancellationToken = default) + void SniffOnConnectionFailure(Auditor? auditor) + Task SniffOnConnectionFailureAsync(Auditor? auditor, CancellationToken cancellationToken) + void SniffOnStaleCluster(Auditor? auditor) + Task SniffOnStaleClusterAsync(Auditor? auditor, CancellationToken cancellationToken) + void ThrowNoNodesAttempted(Endpoint endpoint, Auditor? auditor, List? seenExceptions) + bool TryGetSingleNode(out Node? node) + + abstract class RequestPipelineFactory + abstract RequestPipeline Create(BoundConfiguration boundConfiguration) + + abstract class ResponseFactory + protected ResponseFactory() + abstract TResponse Create(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream? responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats) where TResponse : TransportResponse, new() + abstract Task CreateAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected static bool MayHaveBody(int? statusCode, HttpMethod httpMethod, long contentLength) + + enum SerializationFormatting + None = 0 + Indented = 1 + + abstract class Serializer + protected Serializer() + abstract T Deserialize(Stream stream) + abstract object? Deserialize(Type type, Stream stream) + abstract ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + abstract ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + abstract void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + abstract void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + + sealed class SerializerRegistrationInformation + SerializerRegistrationInformation(Type type, string purpose) + string Purpose { get; } + Type TypeInformation { get; } + override string ToString() + + class SingleNodePool : NodePool + SingleNodePool(Uri uri) + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + + class SniffingNodePool : StaticNodePool + SniffingNodePool(IEnumerable nodes, bool randomize = true) + SniffingNodePool(IEnumerable nodes, Func nodeScorer) + SniffingNodePool(IEnumerable uris, bool randomize = true) + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + protected override void Dispose(bool disposing) + override void Reseed(IEnumerable nodes) + + class StaticNodePool : NodePool + protected StaticNodePool(IEnumerable nodes, bool randomize, int? randomizeSeed = default) + StaticNodePool(IEnumerable nodes, bool randomize = true) + protected StaticNodePool(IEnumerable nodes, Func? nodeScorer = null) + StaticNodePool(IEnumerable uris, bool randomize = true) + protected IReadOnlyList AliveNodes { get; } + protected ref int GlobalCursor { get; } + protected List InternalNodes { get; set; } + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + protected Random Random { get; } + protected bool Randomize { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + protected Node RetryInternalNodes(int globalCursor, Auditor? auditor = null) + protected static IEnumerable SelectAliveNodes(int cursor, IReadOnlyList aliveNodes, Auditor? auditor = null) + protected IOrderedEnumerable SortNodes(IEnumerable nodes) + + sealed class StickyNodePool : StaticNodePool + StickyNodePool(IEnumerable nodes) + StickyNodePool(IEnumerable uris) + override IEnumerable CreateView(Auditor? auditor) + override void Reseed(IEnumerable nodes) + + sealed class StickySniffingNodePool : SniffingNodePool + StickySniffingNodePool(IEnumerable nodes, Func? nodeScorer = null) + StickySniffingNodePool(IEnumerable uris, Func? nodeScorer = null) + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + + sealed class StreamResponse : StreamResponseBase, IDisposable + StreamResponse() + StreamResponse(Stream body, string? contentType) + Stream Body { get; } + + abstract class StreamResponseBase : TransportResponse, IDisposable + protected StreamResponseBase(Stream responseStream, string? contentType = null) + string ContentType { get; } + protected bool Disposed { get; } + protected internal override bool LeaveOpen { get; } + protected Stream Stream { get; } + void Dispose() + protected virtual void Dispose(bool disposing) + + sealed class StringResponse : StringResponseBase + StringResponse() + StringResponse(string body) + + abstract class StringResponseBase : TransportResponse + protected StringResponseBase() + protected StringResponseBase(string body) + + abstract class SystemTextJsonSerializer : Serializer + protected SystemTextJsonSerializer(IJsonSerializerOptionsProvider? provider = null) + override T Deserialize(Stream stream) + override object? Deserialize(Type type, Stream stream) + override ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + override ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + protected internal JsonSerializerOptions GetJsonSerializerOptions(SerializationFormatting formatting = SerializationFormatting.None) + override void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + override void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + override Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + override Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + protected internal virtual bool SupportsFastPath(Type type) + + static class TestableResponseFactory + static T CreateResponse(T response, int httpStatusCode, bool statusCodeRepresentsSuccess) where T : TransportResponse + static T CreateSuccessfulResponse(T response, int httpStatusCode) where T : TransportResponse + + record TransportConfiguration : ITransportConfiguration, IRequestConfiguration, IDisposable, IEquatable + TransportConfiguration(ITransportConfiguration config) + TransportConfiguration(NodePool nodePool, IRequestInvoker? requestInvoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + protected TransportConfiguration(TransportConfiguration original) + TransportConfiguration(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri? uri = null, ProductRegistration? productRegistration = null) + static readonly int DefaultConnectionLimit + static readonly TimeSpan DefaultDnsRefreshTimeout + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + int ConnectionLimit { get; init; } + string? ContentType { get; init; } + DateTimeProvider DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; init; } + virtual bool DebugMode { get; init; } + static MemoryStreamFactory DefaultMemoryStreamFactory { get; } + bool? DisableAuditTrail { get; init; } + bool DisableAutomaticProxyDetection { get; init; } + bool? DisableDirectStreaming { get; init; } + bool DisableMetaHeader { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + TimeSpan DnsRefreshTimeout { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + TimeSpan? KeepAliveInterval { get; init; } + TimeSpan? KeepAliveTime { get; init; } + TimeSpan? MaxDeadTimeout { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + MemoryStreamFactory MemoryStreamFactory { get; init; } + MetaHeaderProvider? MetaHeaderProvider { get; init; } + NodePool NodePool { get; } + Func? NodePredicate { get; init; } + Action? OnConfigurationBound { get; init; } + Action? OnRequestCompleted { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestPipelineFactory PipelineProvider { get; init; } + bool PrettyJson { get; init; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; init; } + string? ProxyPassword { get; init; } + string? ProxyUsername { get; init; } + NameValueCollection? QueryStringParameters { get; init; } + IRequestInvoker RequestInvoker { get; } + RequestMetaData? RequestMetaData { get; init; } + Serializer RequestResponseSerializer { get; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + Func? ServerCertificateValidationCallback { get; init; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; init; } + TimeSpan? SniffInformationLifeSpan { get; init; } + bool SniffsOnConnectionFault { get; init; } + bool SniffsOnStartup { get; init; } + Func StatusCodeToResponseSuccess { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UrlFormatter UrlFormatter { get; init; } + UserAgent UserAgent { get; init; } + virtual TransportConfiguration $() + void Dispose() + virtual bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(TransportConfiguration? left, TransportConfiguration? right) + static bool operator !=(TransportConfiguration? left, TransportConfiguration? right) + + class TransportConfigurationDescriptor : TransportConfigurationDescriptorBase + TransportConfigurationDescriptor(ITransportConfiguration config) + TransportConfigurationDescriptor(NodePool nodePool, IRequestInvoker? invoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(Uri? uri = null, ProductRegistration? productRegistration = null) + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + abstract class TransportConfigurationDescriptorBase : ITransportConfiguration, IRequestConfiguration, IDisposable where T : TransportConfigurationDescriptorBase + protected TransportConfigurationDescriptorBase(ITransportConfiguration config) + protected TransportConfigurationDescriptorBase(NodePool nodePool, IRequestInvoker? requestInvoker, Serializer? requestResponseSerializer, ProductRegistration? productRegistration) + protected Serializer UseThisRequestResponseSerializer { get; set; } + protected T Assign(TValue value, Action assigner) + T Authentication(AuthorizationHeader header) + T CertificateFingerprint(string fingerprint) + T ClientCertificate(X509Certificate certificate) + T ClientCertificate(string certificatePath) + T ClientCertificates(X509CertificateCollection certificates) + T ConnectionLimit(int connectionLimit) + T DeadTimeout(TimeSpan timeout) + T DisableAuditTrail(bool b = true) + T DisableAutomaticProxyDetection(bool disable = true) + T DisableDirectStreaming(bool b = true) + T DisableMetaHeader(bool disable = true) + T DisablePing(bool disable = true) + protected virtual void DisposeManagedResources() + T DnsRefreshTimeout(TimeSpan timeout) + virtual T EnableDebugMode(Action? onRequestCompleted = null) + T EnableHttpCompression(bool enabled = true) + T EnableHttpPipelining(bool enabled = true) + T EnableTcpKeepAlive(TimeSpan keepAliveTime, TimeSpan keepAliveInterval) + T EnableTcpStats(bool enableTcpStats = true) + T EnableThreadPoolStats(bool enableThreadPoolStats = true) + T GlobalHeaders(NameValueCollection headers) + T GlobalQueryStringParameters(NameValueCollection queryStringParameters) + T MaxDeadTimeout(TimeSpan timeout) + T MaxRetryTimeout(TimeSpan maxRetryTimeout) + T MaximumRetries(int maxRetries) + T MemoryStreamFactory(MemoryStreamFactory memoryStreamFactory) + T NodePredicate(Func predicate) + T OnBoundConfigurationCreated(Action handler) + T OnRequestCompleted(Action handler) + virtual T ParseAllHeaders(bool b = true) + T PingTimeout(TimeSpan timeout) + T PipelineProvider(RequestPipelineFactory provider) + virtual T PrettyJson(bool b = true) + T Proxy(Uri proxyAddress, string username, string password) + T Proxy(Uri proxyAddress) + T RequestTimeout(TimeSpan timeout) + T ResponseBuilder(IResponseBuilder responseBuilder) + virtual T ResponseHeadersToParse(HeadersList headersToParse) + T ServerCertificateValidationCallback(Func callback) + T SkipDeserializationForStatusCodes(params int[] statusCodes) + T SniffLifeSpan(TimeSpan? sniffLifeSpan) + T SniffOnConnectionFault(bool sniffsOnConnectionFault = true) + T SniffOnStartup(bool sniffsOnStartup = true) + T ThrowExceptions(bool alwaysThrow = true) + T TransferEncodingChunked(bool transferEncodingChunked = true) + protected T UpdateGlobalQueryString(string key, string value, bool enabled) + T UserAgent(UserAgent userAgent) + + class TransportException : Exception + TransportException(PipelineFailure failure, string message, TransportResponse response) + TransportException(PipelineFailure failure, string message, Exception? innerException = null) + TransportException(string message) + ApiCallDetails? ApiCallDetails { get; } + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + Endpoint? Endpoint { get; } + PipelineFailure? FailureReason { get; } + + static class TransportExtensions + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData, IRequestConfiguration configuration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + static class TransportHttpMethodExtensions + static TResponse Delete(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default) where TResponse : TransportResponse, new() + static TResponse Delete(this ITransport transport, string path, RequestParameters parameters, PostData? data = null) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string path, RequestParameters parameters, PostData? data = null, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string pathAndQuery) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string path, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static VoidResponse Head(this ITransport transport, string pathAndQuery, TimeSpan timeout) + static VoidResponse Head(this ITransport transport, string pathAndQuery) + static VoidResponse Head(this ITransport transport, string path, RequestParameters parameters) + static Task HeadAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string pathAndQuery, TimeSpan timeout, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + abstract class TransportResponse + protected TransportResponse() + [JsonIgnore] + ApiCallDetails ApiCallDetails { get; } + [JsonIgnore] + protected internal virtual bool LeaveOpen { get; } + [JsonIgnore] + protected internal IEnumerable? LinkedDisposables { get; } + override string ToString() + + abstract class TransportResponse : TransportResponse + protected TransportResponse() + T Body { get; protected internal set; } + + class TransportSerializerOptionsProvider : IJsonSerializerOptionsProvider + TransportSerializerOptionsProvider() + TransportSerializerOptionsProvider(IReadOnlyCollection bakedInConverters, IReadOnlyCollection? userProvidedConverters, Action? mutateOptions = null) + JsonSerializerOptions CreateJsonSerializerOptions() + + abstract class TypedResponseBuilder : IResponseBuilder + protected TypedResponseBuilder() + protected abstract TResponse Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) + protected abstract Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) + + class UnexpectedTransportException : TransportException + UnexpectedTransportException(Exception killerException, IReadOnlyCollection? seenExceptions) + IReadOnlyCollection SeenExceptions { get; } + + sealed class UrlFormatter : IFormatProvider, ICustomFormatter + UrlFormatter(ITransportConfiguration settings) + static string CreateString(object? value, ITransportConfiguration settings) + string CreateString(object? value) + string Format(string? format, object? arg, IFormatProvider? formatProvider) + object? GetFormat(Type? formatType) + + sealed class UserAgent + static UserAgent Create(string reposName, Type typeVersionLookup, string[] metadata) + static UserAgent Create(string reposName, Type typeVersionLookup) + static UserAgent Create(string fullUserAgentString) + override string ToString() + + abstract class VersionInfo + protected VersionInfo(SemVersion version) + bool IsPrerelease { get; } + int Major { get; } + string? Metadata { get; } + int Minor { get; } + int Patch { get; } + string? Prerelease { get; } + string ToMetadataHeaderValue() + override string ToString() + + sealed class VoidResponse : TransportResponse + VoidResponse() + static VoidResponse Default { get; } + class VoidBody + VoidBody() + +namespace Elastic.Transport.Diagnostics + static class OpenTelemetry + const string ElasticTransportActivitySourceName = "Elastic.Transport" + static bool ElasticTransportActivitySourceHasListeners { get; } + + class ThreadPoolStatistics + ThreadPoolStatistics(int min, int max, int busy, int free) + int Busy { get; } + int Free { get; } + int Max { get; } + int Min { get; } + + static class ThreadPoolStats + static ReadOnlyDictionary GetStats() + + abstract class TypedDiagnosticObserver : IObserver> + protected TypedDiagnosticObserver(Action> onNextStart, Action> onNextEnd, Action? onError = null, Action? onCompleted = null) + +namespace Elastic.Transport.Diagnostics.Auditing + sealed class Audit + DateTimeOffset Ended { get; } + AuditEvent Event { get; } + Exception? Exception { get; } + Node? Node { get; } + DateTimeOffset Started { get; } + override string ToString() + + enum AuditEvent + SniffOnStartup = 0 + SniffOnFail = 1 + SniffOnStaleCluster = 2 + SniffSuccess = 3 + SniffFailure = 4 + PingSuccess = 5 + PingFailure = 6 + Resurrection = 7 + AllNodesDead = 8 + BadResponse = 9 + HealthyResponse = 10 + MaxTimeoutReached = 11 + MaxRetriesReached = 12 + BadRequest = 13 + NoNodesAttempted = 14 + CancellationRequested = 15 + FailedOverAllNodes = 16 + + class Auditor : IReadOnlyCollection, IEnumerable, IEnumerable + int Count { get; } + void Emit(AuditEvent type, Node node) + void Emit(AuditEvent type) + IEnumerator GetEnumerator() + +namespace Elastic.Transport.Extensions + sealed class SemVersion : IEquatable, IComparable, IComparable + SemVersion(int major, int minor, int patch, string? prerelease, string? metadata) + SemVersion(int major, int minor, int patch, string? prerelease) + SemVersion(int major, int minor, int patch) + int Major { get; } + string Metadata { get; } + int Minor { get; } + int Patch { get; } + string Prerelease { get; } + int CompareByPrecedence(SemVersion? other) + int CompareTo(SemVersion? other) + int CompareTo(object? obj) + bool Equals(SemVersion? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool TryParse(string input, [NotNullWhen(true)] out SemVersion? version) + SemVersion Update(int? major = default, int? minor = default, int? patch = default, string? prerelease = null, string? metadata = null) + static bool operator ==(SemVersion left, SemVersion right) + static bool operator >(SemVersion left, SemVersion right) + static bool operator >=(SemVersion left, SemVersion right) + static bool operator !=(SemVersion left, SemVersion right) + static bool operator <(SemVersion left, SemVersion right) + static bool operator <=(SemVersion left, SemVersion right) + + static class TransportSerializerExtensions + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, string input, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, string input, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, JsonElement node, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, JsonElement node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, JsonNode node, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, JsonNode node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + static bool TryGetJsonSerializerOptions(this Serializer serializer, [NotNullWhen(true)] out JsonSerializerOptions? options, SerializationFormatting formatting = SerializationFormatting.None) + +namespace Elastic.Transport.Products + sealed class DefaultProductRegistration : ProductRegistration + DefaultProductRegistration() + static DefaultProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override HeadersList ResponseHeadersToParse { get; } + override string? ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ProductRegistration + protected ProductRegistration() + abstract string? DefaultContentType { get; } + abstract IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + abstract MetaHeaderProvider MetaHeaderProvider { get; } + abstract string Name { get; } + abstract string ProductAssemblyVersion { get; } + virtual IReadOnlyCollection ResponseBuilders { get; } + abstract HeadersList ResponseHeadersToParse { get; } + abstract string? ServiceIdentifier { get; } + abstract bool SupportsPing { get; } + abstract bool SupportsSniff { get; } + abstract Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + abstract Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + abstract IReadOnlyCollection DefaultHeadersToParse() + abstract bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + virtual bool IsErrorContentType(string? contentType) + virtual bool IsExpectedResponseContentType(string accept, string? responseContentType) + virtual bool IsJsonContentType(string? contentType) + virtual bool IsValidResponse(ApiCallDetails? details) + abstract bool NodePredicate(Node node) + abstract Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + abstract TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract int SniffOrder(Node node) + virtual string? TransformContentType(string? contentType) + virtual ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + abstract bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + +namespace Elastic.Transport.Products.Elasticsearch + record ElasticsearchConfiguration : TransportConfiguration, IEquatable + protected ElasticsearchConfiguration(ElasticsearchConfiguration original) + ElasticsearchConfiguration(string cloudId, ApiKey credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, ApiKey credentials) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, ApiKey credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri? uri = null) + protected override Type EqualityContract { get; } + override TransportConfiguration $() + virtual bool Equals(ElasticsearchConfiguration? other) + sealed override bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected override bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + static bool operator !=(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + + sealed class ElasticsearchDynamicResponse : DynamicResponseBase, IElasticsearchResponse + ElasticsearchDynamicResponse() + ElasticsearchDynamicResponse(DynamicDictionary dictionary) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchErrorExtensions + static bool TryGetElasticsearchServerError(this BytesResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this StringResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this TransportResponse response, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchJsonResponse : JsonResponseBase, IElasticsearchResponse + ElasticsearchJsonResponse() + ElasticsearchJsonResponse(JsonNode node) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchNodeFeatures + static readonly IReadOnlyCollection Default + const string HoldsData = "node.data" + const string HttpEnabled = "node.http" + const string IngestEnabled = "node.ingest" + const string MasterEligible = "node.master" + static readonly IReadOnlyCollection MasterEligibleOnly + static readonly IReadOnlyCollection NotMasterEligible + + class ElasticsearchProductRegistration : ProductRegistration + ElasticsearchProductRegistration(Type markerType) + const string SniffPath = "_nodes/http,settings" + static ProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override IReadOnlyCollection ResponseBuilders { get; } + override HeadersList ResponseHeadersToParse { get; } + sealed override string ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool IsErrorContentType(string? contentType) + override bool IsExpectedResponseContentType(string accept, string? responseContentType) + override bool IsJsonContentType(string? contentType) + override bool IsValidResponse(ApiCallDetails? details) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override string? TransformContentType(string? contentType) + override ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ElasticsearchResponse : TransportResponse, IElasticsearchResponse + protected ElasticsearchResponse() + [JsonIgnore] + string DebugInformation { get; } + [JsonIgnore] + ElasticsearchServerError? ElasticsearchServerError { get; } + [JsonIgnore] + IEnumerable ElasticsearchWarnings { get; } + [JsonIgnore] + virtual bool IsValidResponse { get; } + protected virtual void DebugIsValid(StringBuilder sb) + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ElasticsearchServerError : ErrorResponse + ElasticsearchServerError() + ElasticsearchServerError(Error error, int? statusCode) + [DataMember(Name = "error")] + [JsonPropertyName("error")] + Error? Error { get; init; } + [DataMember(Name = "status")] + [JsonPropertyName("status")] + int Status { get; init; } + static ElasticsearchServerError Create(Stream stream) + static ValueTask CreateAsync(Stream stream, CancellationToken token = default) + override bool HasError() + override string ToString() + static bool TryCreate(Stream stream, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchStreamResponse : StreamResponseBase, IElasticsearchResponse + ElasticsearchStreamResponse() + ElasticsearchStreamResponse(Stream body, string? contentType) + Stream Body { get; } + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + sealed class ElasticsearchStringResponse : StringResponseBase, IElasticsearchResponse + ElasticsearchStringResponse() + ElasticsearchStringResponse(string body) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.13.2411")] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ErrorCause))] + [JsonSerializable(typeof(System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyCollection`1[Elastic.Transport.Products.Elasticsearch.ErrorCause], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyDictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089))] + [JsonSerializable(typeof(System.Object[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089))] + [JsonSerializable(typeof(System.String))] + [JsonSerializable(typeof(System.Text.Json.JsonElement))] + [JsonSourceGenerationOptions(GenerationMode = (JsonSourceGenerationMode)0, UseStringEnumConverter = true)] + class ElasticsearchTransportSerializerContext : JsonSerializerContext, IJsonTypeInfoResolver + ElasticsearchTransportSerializerContext() + ElasticsearchTransportSerializerContext(JsonSerializerOptions options) + static ElasticsearchTransportSerializerContext Default { get; } + JsonTypeInfo> DictionaryStringObject { get; } + JsonTypeInfo ElasticsearchResponse { get; } + JsonTypeInfo ElasticsearchServerError { get; } + JsonTypeInfo Error { get; } + JsonTypeInfo ErrorCause { get; } + protected override JsonSerializerOptions? GeneratedSerializerOptions { get; } + JsonTypeInfo> IReadOnlyCollectionErrorCause { get; } + JsonTypeInfo> IReadOnlyDictionaryStringString { get; } + JsonTypeInfo Int32 { get; } + JsonTypeInfo JsonElement { get; } + JsonTypeInfo Object { get; } + JsonTypeInfo ObjectArray { get; } + JsonTypeInfo String { get; } + override JsonTypeInfo? GetTypeInfo(Type type) + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.Products.Elasticsearch.ErrorConverter))] + sealed class Error : ErrorCause + Error() + [JsonPropertyName("headers")] + IReadOnlyDictionary Headers { get; set; } + [JsonPropertyName("root_cause")] + IReadOnlyCollection? RootCause { get; set; } + override string ToString() + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.ErrorCauseConverter))] + class ErrorCause + ErrorCause() + IReadOnlyDictionary AdditionalProperties { get; } + ErrorCause? CausedBy { get; } + string? Index { get; } + string? IndexUUID { get; } + string? Reason { get; } + [JsonPropertyName("stack_trace")] + string? StackTrace { get; } + string? Type { get; } + override string ToString() + + sealed class ErrorConverter : JsonConverter + ErrorConverter() + override Error? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + override void Write(Utf8JsonWriter writer, Error value, JsonSerializerOptions options) + + interface IElasticsearchResponse + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ShardFailure + ShardFailure() + [JsonPropertyName("index")] + string? Index { get; set; } + [JsonPropertyName("node")] + string? Node { get; set; } + [JsonPropertyName("reason")] + ErrorCause? Reason { get; set; } + [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] + [JsonPropertyName("shard")] + int? Shard { get; set; } + [JsonPropertyName("status")] + string? Status { get; set; } + + static class SniffParser + static Regex AddressRegex { get; } + static Uri ParseToUri(string boundAddress, bool forceHttp) diff --git a/api/Elastic.Transport.net8.0.api b/api/Elastic.Transport.net8.0.api new file mode 100644 index 00000000..53b9e670 --- /dev/null +++ b/api/Elastic.Transport.net8.0.api @@ -0,0 +1,1576 @@ +assembly Elastic.Transport +using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri +using struct System: DateTime, DateTimeOffset, Guid, ReadOnlyMemory<>, ReadOnlySpan<>, TimeSpan, TypeCode +using interface System: IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> +using System.CodeDom.Compiler: GeneratedCodeAttribute +using interface System.Collections: IEnumerable +using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> +using struct System.Collections.Generic: KeyValuePair<,> +using interface System.Collections.Generic: ICollection<>, IDictionary<,>, IEnumerable<>, IReadOnlyCollection<> +using System.Collections.ObjectModel: ReadOnlyDictionary<,> +using System.Collections.Specialized: NameValueCollection +using System.ComponentModel: BrowsableAttribute, EditorBrowsableAttribute +using System.Diagnostics: Activity +using System.Diagnostics.CodeAnalysis: NotNullWhenAttribute, UnconditionalSuppressMessageAttribute +using System.Dynamic: BinaryOperationBinder, ConvertBinder, DynamicObject, GetMemberBinder, SetMemberBinder +using System.IO: MemoryStream, Stream +using System.Linq: IOrderedEnumerable<> +using System.Net: HttpWebRequest, ServicePoint +using System.Net.Http: HttpMessageHandler +using struct System.Net.NetworkInformation: TcpState +using struct System.Net.Security: SslPolicyErrors +using System.Runtime.Serialization: DataContractAttribute, DataMemberAttribute, EnumMemberAttribute +using System.Security.Cryptography.X509Certificates: X509Certificate, X509CertificateCollection, X509Chain +using struct System.Security.Cryptography.X509Certificates: X509RevocationMode +using System.Text: StringBuilder +using System.Text.Json: JsonSerializerOptions, Utf8JsonWriter +using struct System.Text.Json: JsonElement, Utf8JsonReader +using System.Text.Json.Nodes: JsonNode +using System.Text.Json.Serialization: JsonConverter, JsonConverter<>, JsonConverterAttribute, JsonIgnoreAttribute, JsonNumberHandlingAttribute, JsonPropertyNameAttribute, JsonSerializableAttribute, JsonSerializerContext, JsonSourceGenerationOptionsAttribute +using System.Text.Json.Serialization.Metadata: JsonTypeInfo, JsonTypeInfo<> +using interface System.Text.Json.Serialization.Metadata: IJsonTypeInfoResolver +using System.Text.RegularExpressions: Regex +using System.Threading: SemaphoreSlim +using struct System.Threading: CancellationToken +using System.Threading.Tasks: Task, Task<> +using struct System.Threading.Tasks: ValueTask, ValueTask<> + +namespace Elastic.Transport + sealed class ApiCallDetails + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + bool HasExpectedContentType { get; } + bool HasSuccessfulStatusCode { get; } + HttpMethod HttpMethod { get; } + int? HttpStatusCode { get; } + Exception? OriginalException { get; } + ErrorResponse? ProductError { get; } + byte[]? RequestBodyInBytes { get; } + byte[]? ResponseBodyInBytes { get; } + string ResponseContentType { get; set; } + [Obsolete("This property has been retired and replaced by ResponseContentType. Prefer using the updated property as this will be removed in a future release.")] + string ResponseMimeType { get; set; } + Uri? Uri { get; } + override string ToString() + bool TryGetHeader(string key, [NotNullWhen(true)] out IEnumerable? headerValues) + + class ApiKey : AuthorizationHeader + ApiKey(string apiKey) + override string AuthScheme { get; } + override bool TryGetAuthorizationParameters(out string value) + + abstract class AuthorizationHeader + protected AuthorizationHeader() + abstract string AuthScheme { get; } + abstract bool TryGetAuthorizationParameters(out string value) + + class Base64ApiKey : ApiKey + Base64ApiKey(string id, string apiKey) + Base64ApiKey(string base64EncodedApiKey) + + sealed class BasicAuthentication : AuthorizationHeader + BasicAuthentication(string username, string password) + override string AuthScheme { get; } + static string BasicAuthenticationScheme { get; } + static string GetBase64String(string header) + override bool TryGetAuthorizationParameters(out string value) + + sealed record BoundConfiguration : IRequestConfiguration, IEquatable + BoundConfiguration(ITransportConfiguration global, IRequestConfiguration? local = null) + const string DefaultContentType = "application/json" + const string RunAsSecurityHeader = "es-security-runas-user" + string Accept { get; } + IReadOnlyCollection AllowedStatusCodes { get; } + AuthorizationHeader? AuthenticationHeader { get; } + X509CertificateCollection? ClientCertificates { get; } + ITransportConfiguration ConnectionSettings { get; } + string ContentType { get; } + bool DisableAuditTrail { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableDirectStreaming { get; } + bool DisablePings { get; } + bool DisableSniff { get; } + TimeSpan DnsRefreshTimeout { get; } + bool EnableTcpStats { get; } + bool EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool HttpCompression { get; } + bool HttpPipeliningEnabled { get; } + int KeepAliveInterval { get; } + int KeepAliveTime { get; } + int MaxRetries { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + string? OpaqueId { get; } + bool ParseAllHeaders { get; } + TimeSpan PingTimeout { get; } + IReadOnlyCollection ProductResponseBuilders { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + IReadOnlyCollection SkipDeserializationForStatusCodes { get; } + bool ThrowExceptions { get; } + bool TransferEncodingChunked { get; } + UserAgent UserAgent { get; } + BoundConfiguration $() + static BoundConfiguration Create(ITransport transport, IRequestConfiguration requestConfiguration) + bool Equals(BoundConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool operator ==(BoundConfiguration? left, BoundConfiguration? right) + static bool operator !=(BoundConfiguration? left, BoundConfiguration? right) + + sealed class BytesResponse : TransportResponse + BytesResponse() + BytesResponse(byte[] body) + + static class CertificateValidations + static bool AllowAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + static Func AuthorityIsRoot(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static Func AuthorityPartOfChain(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static bool DenyAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + + sealed class CloudNodePool : SingleNodePool + CloudNodePool(string cloudId, AuthorizationHeader credentials, CloudService service) + CloudNodePool(string cloudId, AuthorizationHeader credentials) + CloudNodePool(Uri cloudEndpoint, AuthorizationHeader credentials) + AuthorizationHeader AuthenticationHeader { get; } + + enum CloudService + Elasticsearch = 0 + Kibana = 1 + + abstract class DateTimeProvider + abstract DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + abstract DateTimeOffset Now() + + sealed class DefaultDateTimeProvider : DateTimeProvider + DefaultDateTimeProvider() + static readonly DefaultDateTimeProvider Default + override DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + override DateTimeOffset Now() + + sealed class DefaultMemoryStreamFactory : MemoryStreamFactory + DefaultMemoryStreamFactory() + static DefaultMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class DefaultMetaHeaderProducer : MetaHeaderProducer + DefaultMetaHeaderProducer(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProducer(Type clientType, string serviceIdentifier) + override string HeaderName { get; } + override string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + sealed class DefaultMetaHeaderProvider : MetaHeaderProvider + DefaultMetaHeaderProvider(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProvider(Type clientType, string serviceIdentifier) + override MetaHeaderProducer[] Producers { get; } + + sealed class DefaultRequestParameters : RequestParameters + DefaultRequestParameters() + + sealed class DistributedTransport : DistributedTransport + DistributedTransport(ITransportConfiguration configuration) + + class DistributedTransport : ITransport, ITransport where TConfiguration : class, ITransportConfiguration + DistributedTransport(TConfiguration configuration) + TConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + sealed class DynamicDictionary : DynamicObject, IEquatable, IDictionary, ICollection>, IEnumerable>, IEnumerable + DynamicDictionary() + int Count { get; } + static DynamicDictionary Empty { get; } + bool IsReadOnly { get; } + DynamicValue this[string name] { get; set; } + ICollection Keys { get; } + ICollection Values { get; } + void Add(KeyValuePair item) + void Add(string key, DynamicValue value) + void Clear() + bool Contains(KeyValuePair item) + bool ContainsKey(string key) + void CopyTo(KeyValuePair[] array, int arrayIndex) + static DynamicDictionary Create(IDictionary values) + static DynamicDictionary Create(JsonElement e) + bool Equals(DynamicDictionary? other) + override bool Equals(object? obj) + T Get(string? path) + override IEnumerable GetDynamicMemberNames() + override int GetHashCode() + bool Remove(KeyValuePair item) + bool Remove(string key) + Dictionary ToDictionary() + override bool TryGetMember(GetMemberBinder binder, out object result) + bool TryGetValue(string key, out DynamicValue value) + override bool TrySetMember(SetMemberBinder binder, object? value) + + sealed class DynamicResponse : DynamicResponseBase + DynamicResponse() + DynamicResponse(DynamicDictionary dictionary) + + abstract class DynamicResponseBase : TransportResponse + protected DynamicResponseBase() + protected DynamicResponseBase(DynamicDictionary dictionary) + T Get(string path) + + sealed class DynamicValue : DynamicObject, IEquatable, IConvertible, IReadOnlyCollection, IEnumerable, IEnumerable + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + DynamicValue(object? value) + int Count { get; } + bool HasValue { get; } + DynamicValue this[int i] { get; } + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "Manually verified")] + DynamicValue this[string name] { get; } + static DynamicValue NullValue { get; } + object? Value { get; } + static object? ConsumeJsonElement(Type targetReturnType, JsonElement e) + T? Default(T? defaultValue = null) + bool Equals(DynamicValue? compareValue) + override bool Equals(object? obj) + T? Get(string path) + IEnumerator GetEnumerator() + override int GetHashCode() + TypeCode GetTypeCode() + static DynamicValue SelfOrNew(object v) + bool ToBoolean(IFormatProvider? provider) + byte ToByte(IFormatProvider? provider) + char ToChar(IFormatProvider? provider) + DateTime ToDateTime(IFormatProvider? provider) + decimal ToDecimal(IFormatProvider? provider) + IDictionary? ToDictionary() + double ToDouble(IFormatProvider? provider) + IEnumerable ToEnumerable() + short ToInt16(IFormatProvider? provider) + int ToInt32(IFormatProvider? provider) + long ToInt64(IFormatProvider? provider) + [CLSCompliant(false)] + sbyte ToSByte(IFormatProvider? provider) + float ToSingle(IFormatProvider? provider) + override string? ToString() + string ToString(IFormatProvider? provider) + object ToType(Type conversionType, IFormatProvider? provider) + [CLSCompliant(false)] + ushort ToUInt16(IFormatProvider? provider) + [CLSCompliant(false)] + uint ToUInt32(IFormatProvider? provider) + [CLSCompliant(false)] + ulong ToUInt64(IFormatProvider? provider) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "Manually verified")] + override bool TryBinaryOperation(BinaryOperationBinder binder, object arg, out object? result) + override bool TryConvert(ConvertBinder binder, out object? result) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "Manually verified")] + override bool TryGetMember(GetMemberBinder binder, out object? result) + T? TryParse(T? defaultValue = null) + static bool operator ==(DynamicValue dynamicValue, object compareValue) + static bool operator !=(DynamicValue dynamicValue, object compareValue) + static implicit operator bool(DynamicValue dynamicValue) + static implicit operator string?(DynamicValue dynamicValue) + static implicit operator int(DynamicValue dynamicValue) + static implicit operator Guid(DynamicValue dynamicValue) + static implicit operator DateTime(DynamicValue dynamicValue) + static implicit operator DateTimeOffset(DynamicValue dynamicValue) + static implicit operator TimeSpan(DynamicValue dynamicValue) + static implicit operator long(DynamicValue dynamicValue) + static implicit operator float(DynamicValue dynamicValue) + static implicit operator decimal(DynamicValue dynamicValue) + static implicit operator double(DynamicValue dynamicValue) + + record Endpoint : IEquatable + Endpoint(in EndpointPath Path, Node Node) + protected Endpoint(Endpoint original) + protected virtual Type EqualityContract { get; } + bool IsEmpty { get; } + HttpMethod Method { get; } + Node Node { get; init; } + EndpointPath Path { get; init; } + string PathAndQuery { get; } + Uri Uri { get; } + virtual Endpoint $() + void Deconstruct(out EndpointPath Path, out Node Node) + static Endpoint Empty(in EndpointPath path) + virtual bool Equals(Endpoint? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(Endpoint? left, Endpoint? right) + static bool operator !=(Endpoint? left, Endpoint? right) + + readonly struct EndpointPath : IEquatable + EndpointPath(HttpMethod Method, string PathAndQuery) + HttpMethod Method { get; init; } + string PathAndQuery { get; init; } + void Deconstruct(out HttpMethod Method, out string PathAndQuery) + bool Equals(EndpointPath other) + override bool Equals(object obj) + override int GetHashCode() + override string ToString() + static bool operator ==(EndpointPath left, EndpointPath right) + static bool operator !=(EndpointPath left, EndpointPath right) + + class ErrorCauseConverter : ErrorCauseConverter + ErrorCauseConverter() + + abstract class ErrorCauseConverter : JsonConverter where TErrorCause : ErrorCause, new() + protected ErrorCauseConverter() + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override TErrorCause? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + protected virtual bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, TErrorCause errorCause) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override void Write(Utf8JsonWriter writer, TErrorCause value, JsonSerializerOptions options) + + class ErrorConverter : ErrorCauseConverter + ErrorConverter() + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + protected override bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, Error errorCause) + + abstract class ErrorResponse + abstract bool HasError() + + readonly struct HeadersList : IEnumerable, IEnumerable + HeadersList(IEnumerable headers, IEnumerable otherHeaders) + HeadersList(IEnumerable headers, string additionalHeader) + HeadersList(IEnumerable headers) + HeadersList(HeadersList? headers, HeadersList? otherHeaders) + HeadersList(string header) + int Count { get; } + IEnumerator GetEnumerator() + + enum HttpMethod + [EnumMember(Value = "GET")] + GET = 0 + [EnumMember(Value = "POST")] + POST = 1 + [EnumMember(Value = "PUT")] + PUT = 2 + [EnumMember(Value = "DELETE")] + DELETE = 3 + [EnumMember(Value = "HEAD")] + HEAD = 4 + + static class HttpMethodExtensions + static string GetStringValue(this HttpMethod httpMethod) + + class HttpRequestInvoker : IRequestInvoker, IDisposable + HttpRequestInvoker() + HttpRequestInvoker(Func wrappingHandler) + int InUseHandlers { get; } + int RemovedHandlers { get; } + ResponseFactory ResponseFactory { get; } + protected HttpMessageHandler CreateHttpClientHandler(BoundConfiguration boundConfiguration) + void Dispose() + virtual void DisposeManagedResources() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + [Obsolete("CoreFX HttpWebRequest uses HttpClient under the covers but does not reuse HttpClient instances, do NOT use on .NET core only used as the default on Full Framework")] + class HttpWebRequestInvoker : IRequestInvoker, IDisposable + HttpWebRequestInvoker() + ResponseFactory ResponseFactory { get; } + protected virtual void AlterServicePoint(ServicePoint requestServicePoint, BoundConfiguration boundConfiguration) + protected virtual HttpWebRequest CreateHttpWebRequest(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, bool isAsync) + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected virtual void SetAuthenticationIfNeeded(Endpoint endpoint, BoundConfiguration boundConfiguration, HttpWebRequest request) + protected virtual void SetClientCertificates(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetProxyIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetServerCertificateValidationCallBackIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + + interface IJsonSerializerOptionsProvider + JsonSerializerOptions CreateJsonSerializerOptions() + + interface IRequestConfiguration + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; } + AuthorizationHeader? Authentication { get; } + X509CertificateCollection? ClientCertificates { get; } + string? ContentType { get; } + bool? DisableAuditTrail { get; } + bool? DisableDirectStreaming { get; } + bool? DisablePings { get; } + bool? DisableSniff { get; } + bool? EnableHttpCompression { get; } + bool? EnableTcpStats { get; } + bool? EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool? HttpPipeliningEnabled { get; } + int? MaxRetries { get; } + TimeSpan? MaxRetryTimeout { get; } + string? OpaqueId { get; } + bool? ParseAllHeaders { get; } + TimeSpan? PingTimeout { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan? RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + bool? ThrowExceptions { get; } + bool? TransferEncodingChunked { get; } + UserAgent? UserAgent { get; } + + interface IRequestInvoker : IDisposable + ResponseFactory ResponseFactory { get; } + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + interface IResponseBuilder + TResponse? Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) where TResponse : TransportResponse, new() + Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + bool CanBuild() where TResponse : TransportResponse, new() + + interface IStringable + string GetString() + + interface ITransport + ITransportConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + interface ITransportConfiguration : IRequestConfiguration, IDisposable + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; } + int ConnectionLimit { get; } + DateTimeProvider? DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableMetaHeader { get; } + TimeSpan DnsRefreshTimeout { get; } + TimeSpan? KeepAliveInterval { get; } + TimeSpan? KeepAliveTime { get; } + TimeSpan? MaxDeadTimeout { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + NodePool NodePool { get; } + Func? NodePredicate { get; } + Action? OnConfigurationBound { get; } + Action? OnRequestCompleted { get; } + RequestPipelineFactory? PipelineProvider { get; } + bool PrettyJson { get; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + NameValueCollection? QueryStringParameters { get; } + IRequestInvoker RequestInvoker { get; } + Serializer RequestResponseSerializer { get; } + Func? ServerCertificateValidationCallback { get; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; } + TimeSpan? SniffInformationLifeSpan { get; } + bool SniffsOnConnectionFault { get; } + bool SniffsOnStartup { get; } + Func StatusCodeToResponseSuccess { get; } + UrlFormatter UrlFormatter { get; } + + interface ITransport : ITransport where TConfiguration : class, ITransportConfiguration + TConfiguration Configuration { get; } + + interface IUrlParameter + string GetString(ITransportConfiguration settings) + + class InMemoryRequestInvoker : IRequestInvoker, IDisposable + InMemoryRequestInvoker() + InMemoryRequestInvoker(byte[]? responseBody, int statusCode = 200, Exception? exception = null, string contentType = "application/json", Dictionary>? headers = null) + ResponseFactory ResponseFactory { get; } + TResponse BuildResponse(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + Task BuildResponseAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + sealed class JsonResponse : JsonResponseBase + JsonResponse() + JsonResponse(JsonNode node) + + abstract class JsonResponseBase : TransportResponse + protected JsonResponseBase() + protected JsonResponseBase(JsonNode node) + T Get(string path) + + abstract class MemoryStreamFactory + protected MemoryStreamFactory() + abstract MemoryStream Create() + abstract MemoryStream Create(byte[] bytes, int index, int count) + abstract MemoryStream Create(byte[] bytes) + + sealed class MetaDataHeader + MetaDataHeader(VersionInfo version, string serviceIdentifier, bool isAsync) + string ClientVersion { get; } + string RuntimeVersion { get; } + string ServiceIdentifier { get; } + string? TransportVersion { get; } + override string ToString() + + abstract class MetaHeaderProducer + protected MetaHeaderProducer() + abstract string HeaderName { get; } + abstract string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + abstract class MetaHeaderProvider + protected MetaHeaderProvider() + abstract MetaHeaderProducer[] Producers { get; } + + sealed class Node : IEquatable + Node(Uri uri, IEnumerable? features = null) + DateTimeOffset DeadUntil { get; } + int FailedAttempts { get; } + IReadOnlyCollection Features { get; set; } + string? Id { get; } + bool IsAlive { get; } + bool IsResurrected { get; set; } + string? Name { get; set; } + IReadOnlyDictionary Settings { get; set; } + Uri Uri { get; } + Node Clone() + Uri CreatePath(string path) + bool Equals(Node? other) + override bool Equals(object? obj) + override int GetHashCode() + bool HasFeature(string feature) + void MarkAlive() + void MarkDead(DateTimeOffset until) + static bool operator ==(Node left, Node right) + static bool operator !=(Node left, Node right) + static implicit operator Node(Uri uri) + + abstract class NodePool : IDisposable + protected NodePool() + DateTimeProvider DateTimeProvider { get; set; } + abstract DateTimeOffset? LastUpdate { get; protected set; } + abstract int MaxRetries { get; } + abstract IReadOnlyCollection Nodes { get; } + bool SniffedOnStartup { get; } + abstract bool SupportsPinging { get; } + abstract bool SupportsReseeding { get; } + bool UsingSsl { get; protected set; } + abstract IEnumerable CreateView(Auditor? auditor = null) + void Dispose() + protected virtual void Dispose(bool disposing) + void MarkAsSniffed() + abstract void Reseed(IEnumerable nodes) + + class PipelineException : Exception + PipelineException(PipelineFailure failure, Exception? innerException) + PipelineException(PipelineFailure failure) + PipelineFailure FailureReason { get; } + bool Recoverable { get; } + TransportResponse? Response { get; } + + enum PipelineFailure + BadAuthentication = 0 + BadResponse = 1 + PingFailure = 2 + SniffFailure = 3 + CouldNotStartSniffOnStartup = 4 + MaxTimeoutReached = 5 + MaxRetriesReached = 6 + Unexpected = 7 + BadRequest = 8 + NoNodesAttempted = 9 + + abstract class PostData + protected PostData() + protected const int BufferSize = 81920 + protected static readonly byte[] NewLineByteArray + static PostData Empty { get; } + PostType Type { get; } + byte[]? WrittenBytes { get; } + protected void BufferIfNeeded(MemoryStreamFactory memoryStreamFactory, bool disableDirectStreaming, ref MemoryStream? buffer, ref Stream stream) + static PostData Bytes(byte[] bytes) + protected void FinishStream(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming) + protected ValueTask FinishStreamAsync(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming, CancellationToken ctx) + static PostData MultiJson(IEnumerable listOfSerializables) + static PostData MultiJson(IEnumerable listOfString) + static PostData ReadOnlyMemory(ReadOnlyMemory bytes) + static PostData Serializable(T data) + static PostData StreamHandler(T state, Action syncWriter, Func asyncWriter) + static PostData String(string serializedString) + abstract void Write(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming) + abstract Task WriteAsync(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming, CancellationToken cancellationToken) + static implicit operator PostData(byte[] byteArray) + static implicit operator PostData(string literalString) + + enum PostType + ByteArray = 0 + ReadOnlyMemory = 1 + LiteralString = 2 + Serializable = 3 + EnumerableOfString = 4 + EnumerableOfObject = 5 + StreamHandler = 6 + + sealed class RecyclableMemoryStreamFactory : MemoryStreamFactory + RecyclableMemoryStreamFactory() + static RecyclableMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class ReflectionVersionInfo : VersionInfo + static readonly string TransportVersion + static ReflectionVersionInfo Create() + static ReflectionVersionInfo Create(Type type) + + record RequestConfiguration : IRequestConfiguration, IEquatable + RequestConfiguration() + RequestConfiguration(IRequestConfiguration config) + protected RequestConfiguration(RequestConfiguration original) + static readonly TimeSpan DefaultPingTimeout + static readonly TimeSpan DefaultPingTimeoutOnSsl + static readonly TimeSpan DefaultRequestTimeout + static readonly UserAgent DefaultUserAgent + string? Accept { get; init; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + string? ContentType { get; init; } + bool? DisableAuditTrail { get; init; } + bool? DisableDirectStreaming { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestMetaData? RequestMetaData { get; init; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UserAgent? UserAgent { get; init; } + virtual RequestConfiguration $() + virtual bool Equals(RequestConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(RequestConfiguration? left, RequestConfiguration? right) + static bool operator !=(RequestConfiguration? left, RequestConfiguration? right) + + class RequestConfigurationDescriptor : IRequestConfiguration + RequestConfigurationDescriptor() + RequestConfigurationDescriptor(IRequestConfiguration config) + RequestConfigurationDescriptor Accept(string acceptHeader) + RequestConfigurationDescriptor AllowedStatusCodes(IEnumerable? codes) + RequestConfigurationDescriptor AllowedStatusCodes(params int[] codes) + RequestConfigurationDescriptor Authentication(AuthorizationHeader authentication) + RequestConfigurationDescriptor ClientCertificate(X509Certificate certificate) + RequestConfigurationDescriptor ClientCertificate(string certificatePath) + RequestConfigurationDescriptor ClientCertificates(X509CertificateCollection certificates) + RequestConfigurationDescriptor ContentType(string contentTypeHeader) + RequestConfigurationDescriptor DisableAuditTrail(bool disable = true) + RequestConfigurationDescriptor DisableDirectStreaming(bool disable = true) + RequestConfigurationDescriptor DisablePing(bool disable = true) + RequestConfigurationDescriptor DisableSniffing(bool disable = true) + RequestConfigurationDescriptor EnableHttpCompression(bool enable = true) + RequestConfigurationDescriptor EnableHttpPipelining(bool enable = true) + RequestConfigurationDescriptor EnableTcpStats(bool enableTcpStats = true) + RequestConfigurationDescriptor EnableThreadPoolStats(bool enableThreadPoolStats = true) + RequestConfigurationDescriptor ForceNode(Uri uri) + RequestConfigurationDescriptor GlobalHeaders(NameValueCollection headers) + RequestConfigurationDescriptor MaxRetries(int retry) + RequestConfigurationDescriptor MaxRetries(TimeSpan? timeout) + RequestConfigurationDescriptor OpaqueId(string opaqueId) + RequestConfigurationDescriptor ParseAllHeaders(bool enable = true) + RequestConfigurationDescriptor PingTimeout(TimeSpan pingTimeout) + RequestConfigurationDescriptor RequestMetaData(RequestMetaData metaData) + RequestConfigurationDescriptor RequestTimeout(TimeSpan requestTimeout) + RequestConfigurationDescriptor ResponseBuilder(IResponseBuilder responseBuilder) + RequestConfigurationDescriptor ResponseHeadersToParse(IEnumerable headers) + RequestConfigurationDescriptor RunAs(string username) + RequestConfigurationDescriptor ThrowExceptions(bool throwExceptions = true) + RequestConfigurationDescriptor TransferEncodingChunked(bool transferEncodingChunked = true) + RequestConfigurationDescriptor UserAgent(UserAgent userAgent) + + sealed class RequestMetaData + RequestMetaData() + IReadOnlyDictionary? Items { get; } + + static class RequestMetaDataExtensions + static void AddHelper(this RequestMetaData metaData, string helperValue) + + abstract class RequestParameters + protected RequestParameters() + Dictionary QueryString { get; } + string? AcceptHeaderFromFormat(string? format) + bool ContainsQueryString(string name) + virtual string CreatePathWithQueryStrings(string? path, ITransportConfiguration? globalConfig) + TOut? GetQueryStringValue(string name) + protected void Q(string name, IStringable value) + protected void Q(string name, object value) + protected TOut? Q(string name) + void SetQueryString(string name, object? value) + + class RequestPipeline + void AuditCancellationRequested(Auditor? auditor) + void BadResponse(ref TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, TransportException exception, IReadOnlyCollection? auditTrail) where TResponse : TransportResponse, new() + TResponse CallProductEndpoint(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor) where TResponse : TransportResponse, new() + Task CallProductEndpointAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + TransportException? CreateClientException(TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, Auditor? auditor, DateTimeOffset startedOn, int attemptedNodes, List? seenExceptions) where TResponse : TransportResponse, new() + void FirstPoolUsage(SemaphoreSlim semaphore, Auditor? auditor) + Task FirstPoolUsageAsync(SemaphoreSlim semaphore, Auditor? auditor, CancellationToken cancellationToken) + void MarkAlive(Node node) + void MarkDead(Node node) + IEnumerable NextNode(DateTimeOffset startedOn, int attemptedNodes, Auditor? auditor) + void Ping(Node node, Auditor? auditor) + Task PingAsync(Node node, Auditor? auditor, CancellationToken cancellationToken = default) + void Sniff(Auditor? auditor) + Task SniffAsync(Auditor? auditor, CancellationToken cancellationToken = default) + void SniffOnConnectionFailure(Auditor? auditor) + Task SniffOnConnectionFailureAsync(Auditor? auditor, CancellationToken cancellationToken) + void SniffOnStaleCluster(Auditor? auditor) + Task SniffOnStaleClusterAsync(Auditor? auditor, CancellationToken cancellationToken) + void ThrowNoNodesAttempted(Endpoint endpoint, Auditor? auditor, List? seenExceptions) + bool TryGetSingleNode(out Node? node) + + abstract class RequestPipelineFactory + abstract RequestPipeline Create(BoundConfiguration boundConfiguration) + + abstract class ResponseFactory + protected ResponseFactory() + abstract TResponse Create(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream? responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats) where TResponse : TransportResponse, new() + abstract Task CreateAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected static bool MayHaveBody(int? statusCode, HttpMethod httpMethod, long contentLength) + + enum SerializationFormatting + None = 0 + Indented = 1 + + abstract class Serializer + protected Serializer() + abstract T Deserialize(Stream stream) + abstract object? Deserialize(Type type, Stream stream) + abstract ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + abstract ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + abstract void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + abstract void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + + sealed class SerializerRegistrationInformation + SerializerRegistrationInformation(Type type, string purpose) + string Purpose { get; } + Type TypeInformation { get; } + override string ToString() + + class SingleNodePool : NodePool + SingleNodePool(Uri uri) + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + + class SniffingNodePool : StaticNodePool + SniffingNodePool(IEnumerable nodes, bool randomize = true) + SniffingNodePool(IEnumerable nodes, Func nodeScorer) + SniffingNodePool(IEnumerable uris, bool randomize = true) + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + protected override void Dispose(bool disposing) + override void Reseed(IEnumerable nodes) + + class StaticNodePool : NodePool + protected StaticNodePool(IEnumerable nodes, bool randomize, int? randomizeSeed = default) + StaticNodePool(IEnumerable nodes, bool randomize = true) + protected StaticNodePool(IEnumerable nodes, Func? nodeScorer = null) + StaticNodePool(IEnumerable uris, bool randomize = true) + protected IReadOnlyList AliveNodes { get; } + protected ref int GlobalCursor { get; } + protected List InternalNodes { get; set; } + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + protected Random Random { get; } + protected bool Randomize { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + protected Node RetryInternalNodes(int globalCursor, Auditor? auditor = null) + protected static IEnumerable SelectAliveNodes(int cursor, IReadOnlyList aliveNodes, Auditor? auditor = null) + protected IOrderedEnumerable SortNodes(IEnumerable nodes) + + sealed class StickyNodePool : StaticNodePool + StickyNodePool(IEnumerable nodes) + StickyNodePool(IEnumerable uris) + override IEnumerable CreateView(Auditor? auditor) + override void Reseed(IEnumerable nodes) + + sealed class StickySniffingNodePool : SniffingNodePool + StickySniffingNodePool(IEnumerable nodes, Func? nodeScorer = null) + StickySniffingNodePool(IEnumerable uris, Func? nodeScorer = null) + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + + sealed class StreamResponse : StreamResponseBase, IDisposable + StreamResponse() + StreamResponse(Stream body, string? contentType) + Stream Body { get; } + + abstract class StreamResponseBase : TransportResponse, IDisposable + protected StreamResponseBase(Stream responseStream, string? contentType = null) + string ContentType { get; } + protected bool Disposed { get; } + protected internal override bool LeaveOpen { get; } + protected Stream Stream { get; } + void Dispose() + protected virtual void Dispose(bool disposing) + + sealed class StringResponse : StringResponseBase + StringResponse() + StringResponse(string body) + + abstract class StringResponseBase : TransportResponse + protected StringResponseBase() + protected StringResponseBase(string body) + + abstract class SystemTextJsonSerializer : Serializer + protected SystemTextJsonSerializer(IJsonSerializerOptionsProvider? provider = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override T Deserialize(Stream stream) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override object? Deserialize(Type type, Stream stream) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + protected internal JsonSerializerOptions GetJsonSerializerOptions(SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + protected internal virtual bool SupportsFastPath(Type type) + + static class TestableResponseFactory + static T CreateResponse(T response, int httpStatusCode, bool statusCodeRepresentsSuccess) where T : TransportResponse + static T CreateSuccessfulResponse(T response, int httpStatusCode) where T : TransportResponse + + record TransportConfiguration : ITransportConfiguration, IRequestConfiguration, IDisposable, IEquatable + TransportConfiguration(ITransportConfiguration config) + TransportConfiguration(NodePool nodePool, IRequestInvoker? requestInvoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + protected TransportConfiguration(TransportConfiguration original) + TransportConfiguration(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri? uri = null, ProductRegistration? productRegistration = null) + static readonly int DefaultConnectionLimit + static readonly TimeSpan DefaultDnsRefreshTimeout + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + int ConnectionLimit { get; init; } + string? ContentType { get; init; } + DateTimeProvider DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; init; } + virtual bool DebugMode { get; init; } + static MemoryStreamFactory DefaultMemoryStreamFactory { get; } + bool? DisableAuditTrail { get; init; } + bool DisableAutomaticProxyDetection { get; init; } + bool? DisableDirectStreaming { get; init; } + bool DisableMetaHeader { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + TimeSpan DnsRefreshTimeout { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + TimeSpan? KeepAliveInterval { get; init; } + TimeSpan? KeepAliveTime { get; init; } + TimeSpan? MaxDeadTimeout { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + MemoryStreamFactory MemoryStreamFactory { get; init; } + MetaHeaderProvider? MetaHeaderProvider { get; init; } + NodePool NodePool { get; } + Func? NodePredicate { get; init; } + Action? OnConfigurationBound { get; init; } + Action? OnRequestCompleted { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestPipelineFactory PipelineProvider { get; init; } + bool PrettyJson { get; init; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; init; } + string? ProxyPassword { get; init; } + string? ProxyUsername { get; init; } + NameValueCollection? QueryStringParameters { get; init; } + IRequestInvoker RequestInvoker { get; } + RequestMetaData? RequestMetaData { get; init; } + Serializer RequestResponseSerializer { get; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + Func? ServerCertificateValidationCallback { get; init; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; init; } + TimeSpan? SniffInformationLifeSpan { get; init; } + bool SniffsOnConnectionFault { get; init; } + bool SniffsOnStartup { get; init; } + Func StatusCodeToResponseSuccess { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UrlFormatter UrlFormatter { get; init; } + UserAgent UserAgent { get; init; } + virtual TransportConfiguration $() + void Dispose() + virtual bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(TransportConfiguration? left, TransportConfiguration? right) + static bool operator !=(TransportConfiguration? left, TransportConfiguration? right) + + class TransportConfigurationDescriptor : TransportConfigurationDescriptorBase + TransportConfigurationDescriptor(ITransportConfiguration config) + TransportConfigurationDescriptor(NodePool nodePool, IRequestInvoker? invoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(Uri? uri = null, ProductRegistration? productRegistration = null) + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + abstract class TransportConfigurationDescriptorBase : ITransportConfiguration, IRequestConfiguration, IDisposable where T : TransportConfigurationDescriptorBase + protected TransportConfigurationDescriptorBase(ITransportConfiguration config) + protected TransportConfigurationDescriptorBase(NodePool nodePool, IRequestInvoker? requestInvoker, Serializer? requestResponseSerializer, ProductRegistration? productRegistration) + protected Serializer UseThisRequestResponseSerializer { get; set; } + protected T Assign(TValue value, Action assigner) + T Authentication(AuthorizationHeader header) + T CertificateFingerprint(string fingerprint) + T ClientCertificate(X509Certificate certificate) + T ClientCertificate(string certificatePath) + T ClientCertificates(X509CertificateCollection certificates) + T ConnectionLimit(int connectionLimit) + T DeadTimeout(TimeSpan timeout) + T DisableAuditTrail(bool b = true) + T DisableAutomaticProxyDetection(bool disable = true) + T DisableDirectStreaming(bool b = true) + T DisableMetaHeader(bool disable = true) + T DisablePing(bool disable = true) + protected virtual void DisposeManagedResources() + T DnsRefreshTimeout(TimeSpan timeout) + virtual T EnableDebugMode(Action? onRequestCompleted = null) + T EnableHttpCompression(bool enabled = true) + T EnableHttpPipelining(bool enabled = true) + T EnableTcpKeepAlive(TimeSpan keepAliveTime, TimeSpan keepAliveInterval) + T EnableTcpStats(bool enableTcpStats = true) + T EnableThreadPoolStats(bool enableThreadPoolStats = true) + T GlobalHeaders(NameValueCollection headers) + T GlobalQueryStringParameters(NameValueCollection queryStringParameters) + T MaxDeadTimeout(TimeSpan timeout) + T MaxRetryTimeout(TimeSpan maxRetryTimeout) + T MaximumRetries(int maxRetries) + T MemoryStreamFactory(MemoryStreamFactory memoryStreamFactory) + T NodePredicate(Func predicate) + T OnBoundConfigurationCreated(Action handler) + T OnRequestCompleted(Action handler) + virtual T ParseAllHeaders(bool b = true) + T PingTimeout(TimeSpan timeout) + T PipelineProvider(RequestPipelineFactory provider) + virtual T PrettyJson(bool b = true) + T Proxy(Uri proxyAddress, string username, string password) + T Proxy(Uri proxyAddress) + T RequestTimeout(TimeSpan timeout) + T ResponseBuilder(IResponseBuilder responseBuilder) + virtual T ResponseHeadersToParse(HeadersList headersToParse) + T ServerCertificateValidationCallback(Func callback) + T SkipDeserializationForStatusCodes(params int[] statusCodes) + T SniffLifeSpan(TimeSpan? sniffLifeSpan) + T SniffOnConnectionFault(bool sniffsOnConnectionFault = true) + T SniffOnStartup(bool sniffsOnStartup = true) + T ThrowExceptions(bool alwaysThrow = true) + T TransferEncodingChunked(bool transferEncodingChunked = true) + protected T UpdateGlobalQueryString(string key, string value, bool enabled) + T UserAgent(UserAgent userAgent) + + class TransportException : Exception + TransportException(PipelineFailure failure, string message, TransportResponse response) + TransportException(PipelineFailure failure, string message, Exception? innerException = null) + TransportException(string message) + ApiCallDetails? ApiCallDetails { get; } + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + Endpoint? Endpoint { get; } + PipelineFailure? FailureReason { get; } + + static class TransportExtensions + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData, IRequestConfiguration configuration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + static class TransportHttpMethodExtensions + static TResponse Delete(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default) where TResponse : TransportResponse, new() + static TResponse Delete(this ITransport transport, string path, RequestParameters parameters, PostData? data = null) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string path, RequestParameters parameters, PostData? data = null, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string pathAndQuery) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string path, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static VoidResponse Head(this ITransport transport, string pathAndQuery, TimeSpan timeout) + static VoidResponse Head(this ITransport transport, string pathAndQuery) + static VoidResponse Head(this ITransport transport, string path, RequestParameters parameters) + static Task HeadAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string pathAndQuery, TimeSpan timeout, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + abstract class TransportResponse + protected TransportResponse() + [JsonIgnore] + ApiCallDetails ApiCallDetails { get; } + [JsonIgnore] + protected internal virtual bool LeaveOpen { get; } + [JsonIgnore] + protected internal IEnumerable? LinkedDisposables { get; } + override string ToString() + + abstract class TransportResponse : TransportResponse + protected TransportResponse() + T Body { get; protected internal set; } + + class TransportSerializerOptionsProvider : IJsonSerializerOptionsProvider + TransportSerializerOptionsProvider() + TransportSerializerOptionsProvider(IReadOnlyCollection bakedInConverters, IReadOnlyCollection? userProvidedConverters, Action? mutateOptions = null) + JsonSerializerOptions CreateJsonSerializerOptions() + + abstract class TypedResponseBuilder : IResponseBuilder + protected TypedResponseBuilder() + protected abstract TResponse Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) + protected abstract Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) + + class UnexpectedTransportException : TransportException + UnexpectedTransportException(Exception killerException, IReadOnlyCollection? seenExceptions) + IReadOnlyCollection SeenExceptions { get; } + + sealed class UrlFormatter : IFormatProvider, ICustomFormatter + UrlFormatter(ITransportConfiguration settings) + static string CreateString(object? value, ITransportConfiguration settings) + string CreateString(object? value) + string Format(string? format, object? arg, IFormatProvider? formatProvider) + object? GetFormat(Type? formatType) + + sealed class UserAgent + static UserAgent Create(string reposName, Type typeVersionLookup, string[] metadata) + static UserAgent Create(string reposName, Type typeVersionLookup) + static UserAgent Create(string fullUserAgentString) + override string ToString() + + abstract class VersionInfo + protected VersionInfo(SemVersion version) + bool IsPrerelease { get; } + int Major { get; } + string? Metadata { get; } + int Minor { get; } + int Patch { get; } + string? Prerelease { get; } + string ToMetadataHeaderValue() + override string ToString() + + sealed class VoidResponse : TransportResponse + VoidResponse() + static VoidResponse Default { get; } + class VoidBody + VoidBody() + +namespace Elastic.Transport.Diagnostics + static class OpenTelemetry + const string ElasticTransportActivitySourceName = "Elastic.Transport" + static bool ElasticTransportActivitySourceHasListeners { get; } + + class ThreadPoolStatistics + ThreadPoolStatistics(int min, int max, int busy, int free) + int Busy { get; } + int Free { get; } + int Max { get; } + int Min { get; } + + static class ThreadPoolStats + static ReadOnlyDictionary GetStats() + + abstract class TypedDiagnosticObserver : IObserver> + protected TypedDiagnosticObserver(Action> onNextStart, Action> onNextEnd, Action? onError = null, Action? onCompleted = null) + +namespace Elastic.Transport.Diagnostics.Auditing + sealed class Audit + DateTimeOffset Ended { get; } + AuditEvent Event { get; } + Exception? Exception { get; } + Node? Node { get; } + DateTimeOffset Started { get; } + override string ToString() + + enum AuditEvent + SniffOnStartup = 0 + SniffOnFail = 1 + SniffOnStaleCluster = 2 + SniffSuccess = 3 + SniffFailure = 4 + PingSuccess = 5 + PingFailure = 6 + Resurrection = 7 + AllNodesDead = 8 + BadResponse = 9 + HealthyResponse = 10 + MaxTimeoutReached = 11 + MaxRetriesReached = 12 + BadRequest = 13 + NoNodesAttempted = 14 + CancellationRequested = 15 + FailedOverAllNodes = 16 + + class Auditor : IReadOnlyCollection, IEnumerable, IEnumerable + int Count { get; } + void Emit(AuditEvent type, Node node) + void Emit(AuditEvent type) + IEnumerator GetEnumerator() + +namespace Elastic.Transport.Extensions + sealed class SemVersion : IEquatable, IComparable, IComparable + SemVersion(int major, int minor, int patch, string? prerelease, string? metadata) + SemVersion(int major, int minor, int patch, string? prerelease) + SemVersion(int major, int minor, int patch) + int Major { get; } + string Metadata { get; } + int Minor { get; } + int Patch { get; } + string Prerelease { get; } + int CompareByPrecedence(SemVersion? other) + int CompareTo(SemVersion? other) + int CompareTo(object? obj) + bool Equals(SemVersion? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool TryParse(string input, [NotNullWhen(true)] out SemVersion? version) + SemVersion Update(int? major = default, int? minor = default, int? patch = default, string? prerelease = null, string? metadata = null) + static bool operator ==(SemVersion left, SemVersion right) + static bool operator >(SemVersion left, SemVersion right) + static bool operator >=(SemVersion left, SemVersion right) + static bool operator !=(SemVersion left, SemVersion right) + static bool operator <(SemVersion left, SemVersion right) + static bool operator <=(SemVersion left, SemVersion right) + + static class TransportSerializerExtensions + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, string input, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, string input, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, JsonElement node, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, JsonElement node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, JsonNode node, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, JsonNode node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static byte[] SerializeToBytes(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static string SerializeToString(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static string SerializeToString(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static bool TryGetJsonSerializerOptions(this Serializer serializer, [NotNullWhen(true)] out JsonSerializerOptions? options, SerializationFormatting formatting = SerializationFormatting.None) + +namespace Elastic.Transport.Products + sealed class DefaultProductRegistration : ProductRegistration + DefaultProductRegistration() + static DefaultProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override HeadersList ResponseHeadersToParse { get; } + override string? ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ProductRegistration + protected ProductRegistration() + abstract string? DefaultContentType { get; } + abstract IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + abstract MetaHeaderProvider MetaHeaderProvider { get; } + abstract string Name { get; } + abstract string ProductAssemblyVersion { get; } + virtual IReadOnlyCollection ResponseBuilders { get; } + abstract HeadersList ResponseHeadersToParse { get; } + abstract string? ServiceIdentifier { get; } + abstract bool SupportsPing { get; } + abstract bool SupportsSniff { get; } + abstract Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + abstract Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + abstract IReadOnlyCollection DefaultHeadersToParse() + abstract bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + virtual bool IsErrorContentType(string? contentType) + virtual bool IsExpectedResponseContentType(string accept, string? responseContentType) + virtual bool IsJsonContentType(string? contentType) + virtual bool IsValidResponse(ApiCallDetails? details) + abstract bool NodePredicate(Node node) + abstract Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + abstract TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract int SniffOrder(Node node) + virtual string? TransformContentType(string? contentType) + virtual ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + abstract bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + +namespace Elastic.Transport.Products.Elasticsearch + record ElasticsearchConfiguration : TransportConfiguration, IEquatable + protected ElasticsearchConfiguration(ElasticsearchConfiguration original) + ElasticsearchConfiguration(string cloudId, ApiKey credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, ApiKey credentials) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, ApiKey credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri? uri = null) + protected override Type EqualityContract { get; } + override ElasticsearchConfiguration $() + virtual bool Equals(ElasticsearchConfiguration? other) + sealed override bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected override bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + static bool operator !=(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + + sealed class ElasticsearchDynamicResponse : DynamicResponseBase, IElasticsearchResponse + ElasticsearchDynamicResponse() + ElasticsearchDynamicResponse(DynamicDictionary dictionary) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchErrorExtensions + static bool TryGetElasticsearchServerError(this BytesResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this StringResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this TransportResponse response, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchJsonResponse : JsonResponseBase, IElasticsearchResponse + ElasticsearchJsonResponse() + ElasticsearchJsonResponse(JsonNode node) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchNodeFeatures + static readonly IReadOnlyCollection Default + const string HoldsData = "node.data" + const string HttpEnabled = "node.http" + const string IngestEnabled = "node.ingest" + const string MasterEligible = "node.master" + static readonly IReadOnlyCollection MasterEligibleOnly + static readonly IReadOnlyCollection NotMasterEligible + + class ElasticsearchProductRegistration : ProductRegistration + ElasticsearchProductRegistration(Type markerType) + const string SniffPath = "_nodes/http,settings" + static ProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override IReadOnlyCollection ResponseBuilders { get; } + override HeadersList ResponseHeadersToParse { get; } + sealed override string ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool IsErrorContentType(string? contentType) + override bool IsExpectedResponseContentType(string accept, string? responseContentType) + override bool IsJsonContentType(string? contentType) + override bool IsValidResponse(ApiCallDetails? details) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override string? TransformContentType(string? contentType) + override ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ElasticsearchResponse : TransportResponse, IElasticsearchResponse + protected ElasticsearchResponse() + [JsonIgnore] + string DebugInformation { get; } + [JsonIgnore] + ElasticsearchServerError? ElasticsearchServerError { get; } + [JsonIgnore] + IEnumerable ElasticsearchWarnings { get; } + [JsonIgnore] + virtual bool IsValidResponse { get; } + protected virtual void DebugIsValid(StringBuilder sb) + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ElasticsearchServerError : ErrorResponse + ElasticsearchServerError() + ElasticsearchServerError(Error error, int? statusCode) + [DataMember(Name = "error")] + [JsonPropertyName("error")] + Error? Error { get; init; } + [DataMember(Name = "status")] + [JsonPropertyName("status")] + int Status { get; init; } + static ElasticsearchServerError Create(Stream stream) + static ValueTask CreateAsync(Stream stream, CancellationToken token = default) + override bool HasError() + override string ToString() + static bool TryCreate(Stream stream, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchStreamResponse : StreamResponseBase, IElasticsearchResponse + ElasticsearchStreamResponse() + ElasticsearchStreamResponse(Stream body, string? contentType) + Stream Body { get; } + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + sealed class ElasticsearchStringResponse : StringResponseBase, IElasticsearchResponse + ElasticsearchStringResponse() + ElasticsearchStringResponse(string body) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.13.2411")] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ErrorCause))] + [JsonSerializable(typeof(System.Collections.Generic.Dictionary`2[[System.String, System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Object, System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Collections, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyCollection`1[Elastic.Transport.Products.Elasticsearch.ErrorCause], System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyDictionary`2[[System.String, System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.String, System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.Object[], System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.String))] + [JsonSerializable(typeof(System.Text.Json.JsonElement))] + [JsonSourceGenerationOptions(GenerationMode = (JsonSourceGenerationMode)0, UseStringEnumConverter = true)] + class ElasticsearchTransportSerializerContext : JsonSerializerContext, IJsonTypeInfoResolver + ElasticsearchTransportSerializerContext() + ElasticsearchTransportSerializerContext(JsonSerializerOptions options) + static ElasticsearchTransportSerializerContext Default { get; } + JsonTypeInfo> DictionaryStringObject { get; } + JsonTypeInfo ElasticsearchResponse { get; } + JsonTypeInfo ElasticsearchServerError { get; } + JsonTypeInfo Error { get; } + JsonTypeInfo ErrorCause { get; } + protected override JsonSerializerOptions? GeneratedSerializerOptions { get; } + JsonTypeInfo> IReadOnlyCollectionErrorCause { get; } + JsonTypeInfo> IReadOnlyDictionaryStringString { get; } + JsonTypeInfo Int32 { get; } + JsonTypeInfo JsonElement { get; } + JsonTypeInfo Object { get; } + JsonTypeInfo ObjectArray { get; } + JsonTypeInfo String { get; } + override JsonTypeInfo? GetTypeInfo(Type type) + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.Products.Elasticsearch.ErrorConverter))] + sealed class Error : ErrorCause + Error() + [JsonPropertyName("headers")] + IReadOnlyDictionary Headers { get; set; } + [JsonPropertyName("root_cause")] + IReadOnlyCollection? RootCause { get; set; } + override string ToString() + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.ErrorCauseConverter))] + class ErrorCause + ErrorCause() + IReadOnlyDictionary AdditionalProperties { get; } + ErrorCause? CausedBy { get; } + string? Index { get; } + string? IndexUUID { get; } + string? Reason { get; } + [JsonPropertyName("stack_trace")] + string? StackTrace { get; } + string? Type { get; } + override string ToString() + + sealed class ErrorConverter : JsonConverter + ErrorConverter() + override Error? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + override void Write(Utf8JsonWriter writer, Error value, JsonSerializerOptions options) + + interface IElasticsearchResponse + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ShardFailure + ShardFailure() + [JsonPropertyName("index")] + string? Index { get; set; } + [JsonPropertyName("node")] + string? Node { get; set; } + [JsonPropertyName("reason")] + ErrorCause? Reason { get; set; } + [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] + [JsonPropertyName("shard")] + int? Shard { get; set; } + [JsonPropertyName("status")] + string? Status { get; set; } + + static class SniffParser + static Regex AddressRegex { get; } + static Uri ParseToUri(string boundAddress, bool forceHttp) diff --git a/api/Elastic.Transport.netstandard2.0.api b/api/Elastic.Transport.netstandard2.0.api new file mode 100644 index 00000000..49297185 --- /dev/null +++ b/api/Elastic.Transport.netstandard2.0.api @@ -0,0 +1,1506 @@ +assembly Elastic.Transport +using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri +using struct System: DateTime, DateTimeOffset, Guid, ReadOnlySpan<>, TimeSpan, TypeCode +using interface System: IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> +using System.CodeDom.Compiler: GeneratedCodeAttribute +using interface System.Collections: IEnumerable +using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> +using struct System.Collections.Generic: KeyValuePair<,> +using interface System.Collections.Generic: ICollection<>, IDictionary<,>, IEnumerable<>, IReadOnlyCollection<> +using System.Collections.ObjectModel: ReadOnlyDictionary<,> +using System.Collections.Specialized: NameValueCollection +using System.ComponentModel: BrowsableAttribute, EditorBrowsableAttribute +using System.Diagnostics: Activity +using System.Diagnostics.CodeAnalysis: NotNullWhenAttribute +using System.Dynamic: BinaryOperationBinder, ConvertBinder, DynamicObject, GetMemberBinder, SetMemberBinder +using System.IO: MemoryStream, Stream +using System.Linq: IOrderedEnumerable<> +using System.Net: HttpWebRequest, ServicePoint +using System.Net.Http: HttpMessageHandler +using struct System.Net.NetworkInformation: TcpState +using struct System.Net.Security: SslPolicyErrors +using System.Runtime.Serialization: DataContractAttribute, DataMemberAttribute, EnumMemberAttribute +using System.Security.Cryptography.X509Certificates: X509Certificate, X509CertificateCollection, X509Chain +using struct System.Security.Cryptography.X509Certificates: X509RevocationMode +using System.Text: StringBuilder +using System.Text.Json: JsonSerializerOptions, Utf8JsonWriter +using struct System.Text.Json: JsonElement, Utf8JsonReader +using System.Text.Json.Nodes: JsonNode +using System.Text.Json.Serialization: JsonConverter, JsonConverter<>, JsonConverterAttribute, JsonIgnoreAttribute, JsonNumberHandlingAttribute, JsonPropertyNameAttribute, JsonSerializableAttribute, JsonSerializerContext, JsonSourceGenerationOptionsAttribute +using System.Text.Json.Serialization.Metadata: JsonTypeInfo, JsonTypeInfo<> +using interface System.Text.Json.Serialization.Metadata: IJsonTypeInfoResolver +using System.Text.RegularExpressions: Regex +using System.Threading: SemaphoreSlim +using struct System.Threading: CancellationToken +using System.Threading.Tasks: Task, Task<> +using struct System.Threading.Tasks: ValueTask<> + +namespace Elastic.Transport + sealed class ApiCallDetails + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + bool HasExpectedContentType { get; } + bool HasSuccessfulStatusCode { get; } + HttpMethod HttpMethod { get; } + int? HttpStatusCode { get; } + Exception? OriginalException { get; } + ErrorResponse? ProductError { get; } + byte[]? RequestBodyInBytes { get; } + byte[]? ResponseBodyInBytes { get; } + string ResponseContentType { get; set; } + [Obsolete("This property has been retired and replaced by ResponseContentType. Prefer using the updated property as this will be removed in a future release.")] + string ResponseMimeType { get; set; } + Uri? Uri { get; } + override string ToString() + bool TryGetHeader(string key, [NotNullWhen(true)] out IEnumerable? headerValues) + + class ApiKey : AuthorizationHeader + ApiKey(string apiKey) + override string AuthScheme { get; } + override bool TryGetAuthorizationParameters(out string value) + + abstract class AuthorizationHeader + protected AuthorizationHeader() + abstract string AuthScheme { get; } + abstract bool TryGetAuthorizationParameters(out string value) + + class Base64ApiKey : ApiKey + Base64ApiKey(string id, string apiKey) + Base64ApiKey(string base64EncodedApiKey) + + sealed class BasicAuthentication : AuthorizationHeader + BasicAuthentication(string username, string password) + override string AuthScheme { get; } + static string BasicAuthenticationScheme { get; } + static string GetBase64String(string header) + override bool TryGetAuthorizationParameters(out string value) + + sealed record BoundConfiguration : IRequestConfiguration, IEquatable + BoundConfiguration(ITransportConfiguration global, IRequestConfiguration? local = null) + const string DefaultContentType = "application/json" + const string RunAsSecurityHeader = "es-security-runas-user" + string Accept { get; } + IReadOnlyCollection AllowedStatusCodes { get; } + AuthorizationHeader? AuthenticationHeader { get; } + X509CertificateCollection? ClientCertificates { get; } + ITransportConfiguration ConnectionSettings { get; } + string ContentType { get; } + bool DisableAuditTrail { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableDirectStreaming { get; } + bool DisablePings { get; } + bool DisableSniff { get; } + TimeSpan DnsRefreshTimeout { get; } + bool EnableTcpStats { get; } + bool EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool HttpCompression { get; } + bool HttpPipeliningEnabled { get; } + int KeepAliveInterval { get; } + int KeepAliveTime { get; } + int MaxRetries { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + string? OpaqueId { get; } + bool ParseAllHeaders { get; } + TimeSpan PingTimeout { get; } + IReadOnlyCollection ProductResponseBuilders { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + IReadOnlyCollection SkipDeserializationForStatusCodes { get; } + bool ThrowExceptions { get; } + bool TransferEncodingChunked { get; } + UserAgent UserAgent { get; } + BoundConfiguration $() + static BoundConfiguration Create(ITransport transport, IRequestConfiguration requestConfiguration) + bool Equals(BoundConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool operator ==(BoundConfiguration? left, BoundConfiguration? right) + static bool operator !=(BoundConfiguration? left, BoundConfiguration? right) + + sealed class BytesResponse : TransportResponse + BytesResponse() + BytesResponse(byte[] body) + + static class CertificateValidations + static bool AllowAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + static Func AuthorityIsRoot(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static Func AuthorityPartOfChain(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static bool DenyAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + + sealed class CloudNodePool : SingleNodePool + CloudNodePool(string cloudId, AuthorizationHeader credentials, CloudService service) + CloudNodePool(string cloudId, AuthorizationHeader credentials) + CloudNodePool(Uri cloudEndpoint, AuthorizationHeader credentials) + AuthorizationHeader AuthenticationHeader { get; } + + enum CloudService + Elasticsearch = 0 + Kibana = 1 + + abstract class DateTimeProvider + abstract DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + abstract DateTimeOffset Now() + + sealed class DefaultDateTimeProvider : DateTimeProvider + DefaultDateTimeProvider() + static readonly DefaultDateTimeProvider Default + override DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + override DateTimeOffset Now() + + sealed class DefaultMemoryStreamFactory : MemoryStreamFactory + DefaultMemoryStreamFactory() + static DefaultMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class DefaultMetaHeaderProducer : MetaHeaderProducer + DefaultMetaHeaderProducer(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProducer(Type clientType, string serviceIdentifier) + override string HeaderName { get; } + override string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + sealed class DefaultMetaHeaderProvider : MetaHeaderProvider + DefaultMetaHeaderProvider(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProvider(Type clientType, string serviceIdentifier) + override MetaHeaderProducer[] Producers { get; } + + sealed class DefaultRequestParameters : RequestParameters + DefaultRequestParameters() + + sealed class DistributedTransport : DistributedTransport + DistributedTransport(ITransportConfiguration configuration) + + class DistributedTransport : ITransport, ITransport where TConfiguration : class, ITransportConfiguration + DistributedTransport(TConfiguration configuration) + TConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + sealed class DynamicDictionary : DynamicObject, IEquatable, IDictionary, ICollection>, IEnumerable>, IEnumerable + DynamicDictionary() + int Count { get; } + static DynamicDictionary Empty { get; } + bool IsReadOnly { get; } + DynamicValue this[string name] { get; set; } + ICollection Keys { get; } + ICollection Values { get; } + void Add(KeyValuePair item) + void Add(string key, DynamicValue value) + void Clear() + bool Contains(KeyValuePair item) + bool ContainsKey(string key) + void CopyTo(KeyValuePair[] array, int arrayIndex) + static DynamicDictionary Create(IDictionary values) + static DynamicDictionary Create(JsonElement e) + bool Equals(DynamicDictionary? other) + override bool Equals(object? obj) + T Get(string? path) + override IEnumerable GetDynamicMemberNames() + override int GetHashCode() + bool Remove(KeyValuePair item) + bool Remove(string key) + Dictionary ToDictionary() + override bool TryGetMember(GetMemberBinder binder, out object result) + bool TryGetValue(string key, out DynamicValue value) + override bool TrySetMember(SetMemberBinder binder, object? value) + + sealed class DynamicResponse : DynamicResponseBase + DynamicResponse() + DynamicResponse(DynamicDictionary dictionary) + + abstract class DynamicResponseBase : TransportResponse + protected DynamicResponseBase() + protected DynamicResponseBase(DynamicDictionary dictionary) + T Get(string path) + + sealed class DynamicValue : DynamicObject, IEquatable, IConvertible, IReadOnlyCollection, IEnumerable, IEnumerable + DynamicValue(object? value) + int Count { get; } + bool HasValue { get; } + DynamicValue this[int i] { get; } + DynamicValue this[string name] { get; } + static DynamicValue NullValue { get; } + object? Value { get; } + static object? ConsumeJsonElement(Type targetReturnType, JsonElement e) + T? Default(T? defaultValue = null) + bool Equals(DynamicValue? compareValue) + override bool Equals(object? obj) + T? Get(string path) + IEnumerator GetEnumerator() + override int GetHashCode() + TypeCode GetTypeCode() + static DynamicValue SelfOrNew(object v) + bool ToBoolean(IFormatProvider? provider) + byte ToByte(IFormatProvider? provider) + char ToChar(IFormatProvider? provider) + DateTime ToDateTime(IFormatProvider? provider) + decimal ToDecimal(IFormatProvider? provider) + IDictionary? ToDictionary() + double ToDouble(IFormatProvider? provider) + IEnumerable ToEnumerable() + short ToInt16(IFormatProvider? provider) + int ToInt32(IFormatProvider? provider) + long ToInt64(IFormatProvider? provider) + [CLSCompliant(false)] + sbyte ToSByte(IFormatProvider? provider) + float ToSingle(IFormatProvider? provider) + override string? ToString() + string ToString(IFormatProvider? provider) + object ToType(Type conversionType, IFormatProvider? provider) + [CLSCompliant(false)] + ushort ToUInt16(IFormatProvider? provider) + [CLSCompliant(false)] + uint ToUInt32(IFormatProvider? provider) + [CLSCompliant(false)] + ulong ToUInt64(IFormatProvider? provider) + override bool TryBinaryOperation(BinaryOperationBinder binder, object arg, out object? result) + override bool TryConvert(ConvertBinder binder, out object? result) + override bool TryGetMember(GetMemberBinder binder, out object? result) + T? TryParse(T? defaultValue = null) + static bool operator ==(DynamicValue dynamicValue, object compareValue) + static bool operator !=(DynamicValue dynamicValue, object compareValue) + static implicit operator bool(DynamicValue dynamicValue) + static implicit operator string?(DynamicValue dynamicValue) + static implicit operator int(DynamicValue dynamicValue) + static implicit operator Guid(DynamicValue dynamicValue) + static implicit operator DateTime(DynamicValue dynamicValue) + static implicit operator DateTimeOffset(DynamicValue dynamicValue) + static implicit operator TimeSpan(DynamicValue dynamicValue) + static implicit operator long(DynamicValue dynamicValue) + static implicit operator float(DynamicValue dynamicValue) + static implicit operator decimal(DynamicValue dynamicValue) + static implicit operator double(DynamicValue dynamicValue) + + record Endpoint : IEquatable + Endpoint(in EndpointPath Path, Node Node) + protected Endpoint(Endpoint original) + protected virtual Type EqualityContract { get; } + bool IsEmpty { get; } + HttpMethod Method { get; } + Node Node { get; init; } + EndpointPath Path { get; init; } + string PathAndQuery { get; } + Uri Uri { get; } + virtual Endpoint $() + void Deconstruct(out EndpointPath Path, out Node Node) + static Endpoint Empty(in EndpointPath path) + virtual bool Equals(Endpoint? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(Endpoint? left, Endpoint? right) + static bool operator !=(Endpoint? left, Endpoint? right) + + readonly struct EndpointPath : IEquatable + EndpointPath(HttpMethod Method, string PathAndQuery) + HttpMethod Method { get; init; } + string PathAndQuery { get; init; } + void Deconstruct(out HttpMethod Method, out string PathAndQuery) + bool Equals(EndpointPath other) + override bool Equals(object obj) + override int GetHashCode() + override string ToString() + static bool operator ==(EndpointPath left, EndpointPath right) + static bool operator !=(EndpointPath left, EndpointPath right) + + class ErrorCauseConverter : ErrorCauseConverter + ErrorCauseConverter() + + abstract class ErrorCauseConverter : JsonConverter where TErrorCause : ErrorCause, new() + protected ErrorCauseConverter() + override TErrorCause? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + protected virtual bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, TErrorCause errorCause) + override void Write(Utf8JsonWriter writer, TErrorCause value, JsonSerializerOptions options) + + class ErrorConverter : ErrorCauseConverter + ErrorConverter() + protected override bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, Error errorCause) + + abstract class ErrorResponse + abstract bool HasError() + + readonly struct HeadersList : IEnumerable, IEnumerable + HeadersList(IEnumerable headers, IEnumerable otherHeaders) + HeadersList(IEnumerable headers, string additionalHeader) + HeadersList(IEnumerable headers) + HeadersList(HeadersList? headers, HeadersList? otherHeaders) + HeadersList(string header) + int Count { get; } + IEnumerator GetEnumerator() + + enum HttpMethod + [EnumMember(Value = "GET")] + GET = 0 + [EnumMember(Value = "POST")] + POST = 1 + [EnumMember(Value = "PUT")] + PUT = 2 + [EnumMember(Value = "DELETE")] + DELETE = 3 + [EnumMember(Value = "HEAD")] + HEAD = 4 + + static class HttpMethodExtensions + static string GetStringValue(this HttpMethod httpMethod) + + class HttpRequestInvoker : IRequestInvoker, IDisposable + HttpRequestInvoker() + HttpRequestInvoker(Func wrappingHandler) + int InUseHandlers { get; } + int RemovedHandlers { get; } + ResponseFactory ResponseFactory { get; } + protected HttpMessageHandler CreateHttpClientHandler(BoundConfiguration boundConfiguration) + void Dispose() + virtual void DisposeManagedResources() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + [Obsolete("CoreFX HttpWebRequest uses HttpClient under the covers but does not reuse HttpClient instances, do NOT use on .NET core only used as the default on Full Framework")] + class HttpWebRequestInvoker : IRequestInvoker, IDisposable + HttpWebRequestInvoker() + ResponseFactory ResponseFactory { get; } + protected virtual void AlterServicePoint(ServicePoint requestServicePoint, BoundConfiguration boundConfiguration) + protected virtual HttpWebRequest CreateHttpWebRequest(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, bool isAsync) + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected virtual void SetAuthenticationIfNeeded(Endpoint endpoint, BoundConfiguration boundConfiguration, HttpWebRequest request) + protected virtual void SetClientCertificates(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetProxyIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetServerCertificateValidationCallBackIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + + interface IJsonSerializerOptionsProvider + JsonSerializerOptions CreateJsonSerializerOptions() + + interface IRequestConfiguration + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; } + AuthorizationHeader? Authentication { get; } + X509CertificateCollection? ClientCertificates { get; } + string? ContentType { get; } + bool? DisableAuditTrail { get; } + bool? DisableDirectStreaming { get; } + bool? DisablePings { get; } + bool? DisableSniff { get; } + bool? EnableHttpCompression { get; } + bool? EnableTcpStats { get; } + bool? EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool? HttpPipeliningEnabled { get; } + int? MaxRetries { get; } + TimeSpan? MaxRetryTimeout { get; } + string? OpaqueId { get; } + bool? ParseAllHeaders { get; } + TimeSpan? PingTimeout { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan? RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + bool? ThrowExceptions { get; } + bool? TransferEncodingChunked { get; } + UserAgent? UserAgent { get; } + + interface IRequestInvoker : IDisposable + ResponseFactory ResponseFactory { get; } + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + interface IResponseBuilder + TResponse? Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) where TResponse : TransportResponse, new() + Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + bool CanBuild() where TResponse : TransportResponse, new() + + interface IStringable + string GetString() + + interface ITransport + ITransportConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + interface ITransportConfiguration : IRequestConfiguration, IDisposable + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; } + int ConnectionLimit { get; } + DateTimeProvider? DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableMetaHeader { get; } + TimeSpan DnsRefreshTimeout { get; } + TimeSpan? KeepAliveInterval { get; } + TimeSpan? KeepAliveTime { get; } + TimeSpan? MaxDeadTimeout { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + NodePool NodePool { get; } + Func? NodePredicate { get; } + Action? OnConfigurationBound { get; } + Action? OnRequestCompleted { get; } + RequestPipelineFactory? PipelineProvider { get; } + bool PrettyJson { get; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + NameValueCollection? QueryStringParameters { get; } + IRequestInvoker RequestInvoker { get; } + Serializer RequestResponseSerializer { get; } + Func? ServerCertificateValidationCallback { get; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; } + TimeSpan? SniffInformationLifeSpan { get; } + bool SniffsOnConnectionFault { get; } + bool SniffsOnStartup { get; } + Func StatusCodeToResponseSuccess { get; } + UrlFormatter UrlFormatter { get; } + + interface ITransport : ITransport where TConfiguration : class, ITransportConfiguration + TConfiguration Configuration { get; } + + interface IUrlParameter + string GetString(ITransportConfiguration settings) + + class InMemoryRequestInvoker : IRequestInvoker, IDisposable + InMemoryRequestInvoker() + InMemoryRequestInvoker(byte[]? responseBody, int statusCode = 200, Exception? exception = null, string contentType = "application/json", Dictionary>? headers = null) + ResponseFactory ResponseFactory { get; } + TResponse BuildResponse(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + Task BuildResponseAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + sealed class JsonResponse : JsonResponseBase + JsonResponse() + JsonResponse(JsonNode node) + + abstract class JsonResponseBase : TransportResponse + protected JsonResponseBase() + protected JsonResponseBase(JsonNode node) + T Get(string path) + + abstract class MemoryStreamFactory + protected MemoryStreamFactory() + abstract MemoryStream Create() + abstract MemoryStream Create(byte[] bytes, int index, int count) + abstract MemoryStream Create(byte[] bytes) + + sealed class MetaDataHeader + MetaDataHeader(VersionInfo version, string serviceIdentifier, bool isAsync) + string ClientVersion { get; } + string RuntimeVersion { get; } + string ServiceIdentifier { get; } + string? TransportVersion { get; } + override string ToString() + + abstract class MetaHeaderProducer + protected MetaHeaderProducer() + abstract string HeaderName { get; } + abstract string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + abstract class MetaHeaderProvider + protected MetaHeaderProvider() + abstract MetaHeaderProducer[] Producers { get; } + + sealed class Node : IEquatable + Node(Uri uri, IEnumerable? features = null) + DateTimeOffset DeadUntil { get; } + int FailedAttempts { get; } + IReadOnlyCollection Features { get; set; } + string? Id { get; } + bool IsAlive { get; } + bool IsResurrected { get; set; } + string? Name { get; set; } + IReadOnlyDictionary Settings { get; set; } + Uri Uri { get; } + Node Clone() + Uri CreatePath(string path) + bool Equals(Node? other) + override bool Equals(object? obj) + override int GetHashCode() + bool HasFeature(string feature) + void MarkAlive() + void MarkDead(DateTimeOffset until) + static bool operator ==(Node left, Node right) + static bool operator !=(Node left, Node right) + static implicit operator Node(Uri uri) + + abstract class NodePool : IDisposable + protected NodePool() + DateTimeProvider DateTimeProvider { get; set; } + abstract DateTimeOffset? LastUpdate { get; protected set; } + abstract int MaxRetries { get; } + abstract IReadOnlyCollection Nodes { get; } + bool SniffedOnStartup { get; } + abstract bool SupportsPinging { get; } + abstract bool SupportsReseeding { get; } + bool UsingSsl { get; protected set; } + abstract IEnumerable CreateView(Auditor? auditor = null) + void Dispose() + protected virtual void Dispose(bool disposing) + void MarkAsSniffed() + abstract void Reseed(IEnumerable nodes) + + class PipelineException : Exception + PipelineException(PipelineFailure failure, Exception? innerException) + PipelineException(PipelineFailure failure) + PipelineFailure FailureReason { get; } + bool Recoverable { get; } + TransportResponse? Response { get; } + + enum PipelineFailure + BadAuthentication = 0 + BadResponse = 1 + PingFailure = 2 + SniffFailure = 3 + CouldNotStartSniffOnStartup = 4 + MaxTimeoutReached = 5 + MaxRetriesReached = 6 + Unexpected = 7 + BadRequest = 8 + NoNodesAttempted = 9 + + abstract class PostData + protected PostData() + protected const int BufferSize = 81920 + protected static readonly byte[] NewLineByteArray + static PostData Empty { get; } + PostType Type { get; } + byte[]? WrittenBytes { get; } + protected void BufferIfNeeded(MemoryStreamFactory memoryStreamFactory, bool disableDirectStreaming, ref MemoryStream? buffer, ref Stream stream) + static PostData Bytes(byte[] bytes) + protected void FinishStream(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming) + protected Task FinishStreamAsync(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming, CancellationToken ctx) + static PostData MultiJson(IEnumerable listOfSerializables) + static PostData MultiJson(IEnumerable listOfString) + static PostData Serializable(T data) + static PostData StreamHandler(T state, Action syncWriter, Func asyncWriter) + static PostData String(string serializedString) + abstract void Write(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming) + abstract Task WriteAsync(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming, CancellationToken cancellationToken) + static implicit operator PostData(byte[] byteArray) + static implicit operator PostData(string literalString) + + enum PostType + ByteArray = 0 + LiteralString = 1 + Serializable = 2 + EnumerableOfString = 3 + EnumerableOfObject = 4 + StreamHandler = 5 + + sealed class RecyclableMemoryStreamFactory : MemoryStreamFactory + RecyclableMemoryStreamFactory() + static RecyclableMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class ReflectionVersionInfo : VersionInfo + static readonly string TransportVersion + static ReflectionVersionInfo Create() + static ReflectionVersionInfo Create(Type type) + + record RequestConfiguration : IRequestConfiguration, IEquatable + RequestConfiguration() + RequestConfiguration(IRequestConfiguration config) + protected RequestConfiguration(RequestConfiguration original) + static readonly TimeSpan DefaultPingTimeout + static readonly TimeSpan DefaultPingTimeoutOnSsl + static readonly TimeSpan DefaultRequestTimeout + static readonly UserAgent DefaultUserAgent + string? Accept { get; init; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + string? ContentType { get; init; } + bool? DisableAuditTrail { get; init; } + bool? DisableDirectStreaming { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestMetaData? RequestMetaData { get; init; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UserAgent? UserAgent { get; init; } + virtual RequestConfiguration $() + virtual bool Equals(RequestConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(RequestConfiguration? left, RequestConfiguration? right) + static bool operator !=(RequestConfiguration? left, RequestConfiguration? right) + + class RequestConfigurationDescriptor : IRequestConfiguration + RequestConfigurationDescriptor() + RequestConfigurationDescriptor(IRequestConfiguration config) + RequestConfigurationDescriptor Accept(string acceptHeader) + RequestConfigurationDescriptor AllowedStatusCodes(IEnumerable? codes) + RequestConfigurationDescriptor AllowedStatusCodes(params int[] codes) + RequestConfigurationDescriptor Authentication(AuthorizationHeader authentication) + RequestConfigurationDescriptor ClientCertificate(X509Certificate certificate) + RequestConfigurationDescriptor ClientCertificate(string certificatePath) + RequestConfigurationDescriptor ClientCertificates(X509CertificateCollection certificates) + RequestConfigurationDescriptor ContentType(string contentTypeHeader) + RequestConfigurationDescriptor DisableAuditTrail(bool disable = true) + RequestConfigurationDescriptor DisableDirectStreaming(bool disable = true) + RequestConfigurationDescriptor DisablePing(bool disable = true) + RequestConfigurationDescriptor DisableSniffing(bool disable = true) + RequestConfigurationDescriptor EnableHttpCompression(bool enable = true) + RequestConfigurationDescriptor EnableHttpPipelining(bool enable = true) + RequestConfigurationDescriptor EnableTcpStats(bool enableTcpStats = true) + RequestConfigurationDescriptor EnableThreadPoolStats(bool enableThreadPoolStats = true) + RequestConfigurationDescriptor ForceNode(Uri uri) + RequestConfigurationDescriptor GlobalHeaders(NameValueCollection headers) + RequestConfigurationDescriptor MaxRetries(int retry) + RequestConfigurationDescriptor MaxRetries(TimeSpan? timeout) + RequestConfigurationDescriptor OpaqueId(string opaqueId) + RequestConfigurationDescriptor ParseAllHeaders(bool enable = true) + RequestConfigurationDescriptor PingTimeout(TimeSpan pingTimeout) + RequestConfigurationDescriptor RequestMetaData(RequestMetaData metaData) + RequestConfigurationDescriptor RequestTimeout(TimeSpan requestTimeout) + RequestConfigurationDescriptor ResponseBuilder(IResponseBuilder responseBuilder) + RequestConfigurationDescriptor ResponseHeadersToParse(IEnumerable headers) + RequestConfigurationDescriptor RunAs(string username) + RequestConfigurationDescriptor ThrowExceptions(bool throwExceptions = true) + RequestConfigurationDescriptor TransferEncodingChunked(bool transferEncodingChunked = true) + RequestConfigurationDescriptor UserAgent(UserAgent userAgent) + + sealed class RequestMetaData + RequestMetaData() + IReadOnlyDictionary? Items { get; } + + static class RequestMetaDataExtensions + static void AddHelper(this RequestMetaData metaData, string helperValue) + + abstract class RequestParameters + protected RequestParameters() + Dictionary QueryString { get; } + string? AcceptHeaderFromFormat(string? format) + bool ContainsQueryString(string name) + virtual string CreatePathWithQueryStrings(string? path, ITransportConfiguration? globalConfig) + TOut? GetQueryStringValue(string name) + protected void Q(string name, IStringable value) + protected void Q(string name, object value) + protected TOut? Q(string name) + void SetQueryString(string name, object? value) + + class RequestPipeline + void AuditCancellationRequested(Auditor? auditor) + void BadResponse(ref TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, TransportException exception, IReadOnlyCollection? auditTrail) where TResponse : TransportResponse, new() + TResponse CallProductEndpoint(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor) where TResponse : TransportResponse, new() + Task CallProductEndpointAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + TransportException? CreateClientException(TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, Auditor? auditor, DateTimeOffset startedOn, int attemptedNodes, List? seenExceptions) where TResponse : TransportResponse, new() + void FirstPoolUsage(SemaphoreSlim semaphore, Auditor? auditor) + Task FirstPoolUsageAsync(SemaphoreSlim semaphore, Auditor? auditor, CancellationToken cancellationToken) + void MarkAlive(Node node) + void MarkDead(Node node) + IEnumerable NextNode(DateTimeOffset startedOn, int attemptedNodes, Auditor? auditor) + void Ping(Node node, Auditor? auditor) + Task PingAsync(Node node, Auditor? auditor, CancellationToken cancellationToken = default) + void Sniff(Auditor? auditor) + Task SniffAsync(Auditor? auditor, CancellationToken cancellationToken = default) + void SniffOnConnectionFailure(Auditor? auditor) + Task SniffOnConnectionFailureAsync(Auditor? auditor, CancellationToken cancellationToken) + void SniffOnStaleCluster(Auditor? auditor) + Task SniffOnStaleClusterAsync(Auditor? auditor, CancellationToken cancellationToken) + void ThrowNoNodesAttempted(Endpoint endpoint, Auditor? auditor, List? seenExceptions) + bool TryGetSingleNode(out Node? node) + + abstract class RequestPipelineFactory + abstract RequestPipeline Create(BoundConfiguration boundConfiguration) + + abstract class ResponseFactory + protected ResponseFactory() + abstract TResponse Create(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream? responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats) where TResponse : TransportResponse, new() + abstract Task CreateAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected static bool MayHaveBody(int? statusCode, HttpMethod httpMethod, long contentLength) + + enum SerializationFormatting + None = 0 + Indented = 1 + + abstract class Serializer + protected Serializer() + abstract T Deserialize(Stream stream) + abstract object? Deserialize(Type type, Stream stream) + abstract ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + abstract ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + abstract void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + abstract void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + + sealed class SerializerRegistrationInformation + SerializerRegistrationInformation(Type type, string purpose) + string Purpose { get; } + Type TypeInformation { get; } + override string ToString() + + class SingleNodePool : NodePool + SingleNodePool(Uri uri) + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + + class SniffingNodePool : StaticNodePool + SniffingNodePool(IEnumerable nodes, bool randomize = true) + SniffingNodePool(IEnumerable nodes, Func nodeScorer) + SniffingNodePool(IEnumerable uris, bool randomize = true) + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + protected override void Dispose(bool disposing) + override void Reseed(IEnumerable nodes) + + class StaticNodePool : NodePool + protected StaticNodePool(IEnumerable nodes, bool randomize, int? randomizeSeed = default) + StaticNodePool(IEnumerable nodes, bool randomize = true) + protected StaticNodePool(IEnumerable nodes, Func? nodeScorer = null) + StaticNodePool(IEnumerable uris, bool randomize = true) + protected IReadOnlyList AliveNodes { get; } + protected ref int GlobalCursor { get; } + protected List InternalNodes { get; set; } + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + protected Random Random { get; } + protected bool Randomize { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + protected Node RetryInternalNodes(int globalCursor, Auditor? auditor = null) + protected static IEnumerable SelectAliveNodes(int cursor, IReadOnlyList aliveNodes, Auditor? auditor = null) + protected IOrderedEnumerable SortNodes(IEnumerable nodes) + + sealed class StickyNodePool : StaticNodePool + StickyNodePool(IEnumerable nodes) + StickyNodePool(IEnumerable uris) + override IEnumerable CreateView(Auditor? auditor) + override void Reseed(IEnumerable nodes) + + sealed class StickySniffingNodePool : SniffingNodePool + StickySniffingNodePool(IEnumerable nodes, Func? nodeScorer = null) + StickySniffingNodePool(IEnumerable uris, Func? nodeScorer = null) + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + + sealed class StreamResponse : StreamResponseBase, IDisposable + StreamResponse() + StreamResponse(Stream body, string? contentType) + Stream Body { get; } + + abstract class StreamResponseBase : TransportResponse, IDisposable + protected StreamResponseBase(Stream responseStream, string? contentType = null) + string ContentType { get; } + protected bool Disposed { get; } + protected internal override bool LeaveOpen { get; } + protected Stream Stream { get; } + void Dispose() + protected virtual void Dispose(bool disposing) + + sealed class StringResponse : StringResponseBase + StringResponse() + StringResponse(string body) + + abstract class StringResponseBase : TransportResponse + protected StringResponseBase() + protected StringResponseBase(string body) + + abstract class SystemTextJsonSerializer : Serializer + protected SystemTextJsonSerializer(IJsonSerializerOptionsProvider? provider = null) + override T Deserialize(Stream stream) + override object? Deserialize(Type type, Stream stream) + override ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + override ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + protected internal JsonSerializerOptions GetJsonSerializerOptions(SerializationFormatting formatting = SerializationFormatting.None) + override void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + override void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + override Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + override Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + protected internal virtual bool SupportsFastPath(Type type) + + static class TestableResponseFactory + static T CreateResponse(T response, int httpStatusCode, bool statusCodeRepresentsSuccess) where T : TransportResponse + static T CreateSuccessfulResponse(T response, int httpStatusCode) where T : TransportResponse + + record TransportConfiguration : ITransportConfiguration, IRequestConfiguration, IDisposable, IEquatable + TransportConfiguration(ITransportConfiguration config) + TransportConfiguration(NodePool nodePool, IRequestInvoker? requestInvoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + protected TransportConfiguration(TransportConfiguration original) + TransportConfiguration(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri? uri = null, ProductRegistration? productRegistration = null) + static readonly int DefaultConnectionLimit + static readonly TimeSpan DefaultDnsRefreshTimeout + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + int ConnectionLimit { get; init; } + string? ContentType { get; init; } + DateTimeProvider DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; init; } + virtual bool DebugMode { get; init; } + static MemoryStreamFactory DefaultMemoryStreamFactory { get; } + bool? DisableAuditTrail { get; init; } + bool DisableAutomaticProxyDetection { get; init; } + bool? DisableDirectStreaming { get; init; } + bool DisableMetaHeader { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + TimeSpan DnsRefreshTimeout { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + TimeSpan? KeepAliveInterval { get; init; } + TimeSpan? KeepAliveTime { get; init; } + TimeSpan? MaxDeadTimeout { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + MemoryStreamFactory MemoryStreamFactory { get; init; } + MetaHeaderProvider? MetaHeaderProvider { get; init; } + NodePool NodePool { get; } + Func? NodePredicate { get; init; } + Action? OnConfigurationBound { get; init; } + Action? OnRequestCompleted { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestPipelineFactory PipelineProvider { get; init; } + bool PrettyJson { get; init; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; init; } + string? ProxyPassword { get; init; } + string? ProxyUsername { get; init; } + NameValueCollection? QueryStringParameters { get; init; } + IRequestInvoker RequestInvoker { get; } + RequestMetaData? RequestMetaData { get; init; } + Serializer RequestResponseSerializer { get; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + Func? ServerCertificateValidationCallback { get; init; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; init; } + TimeSpan? SniffInformationLifeSpan { get; init; } + bool SniffsOnConnectionFault { get; init; } + bool SniffsOnStartup { get; init; } + Func StatusCodeToResponseSuccess { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UrlFormatter UrlFormatter { get; init; } + UserAgent UserAgent { get; init; } + virtual TransportConfiguration $() + void Dispose() + virtual bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(TransportConfiguration? left, TransportConfiguration? right) + static bool operator !=(TransportConfiguration? left, TransportConfiguration? right) + + class TransportConfigurationDescriptor : TransportConfigurationDescriptorBase + TransportConfigurationDescriptor(ITransportConfiguration config) + TransportConfigurationDescriptor(NodePool nodePool, IRequestInvoker? invoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(Uri? uri = null, ProductRegistration? productRegistration = null) + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + abstract class TransportConfigurationDescriptorBase : ITransportConfiguration, IRequestConfiguration, IDisposable where T : TransportConfigurationDescriptorBase + protected TransportConfigurationDescriptorBase(ITransportConfiguration config) + protected TransportConfigurationDescriptorBase(NodePool nodePool, IRequestInvoker? requestInvoker, Serializer? requestResponseSerializer, ProductRegistration? productRegistration) + protected Serializer UseThisRequestResponseSerializer { get; set; } + protected T Assign(TValue value, Action assigner) + T Authentication(AuthorizationHeader header) + T CertificateFingerprint(string fingerprint) + T ClientCertificate(X509Certificate certificate) + T ClientCertificate(string certificatePath) + T ClientCertificates(X509CertificateCollection certificates) + T ConnectionLimit(int connectionLimit) + T DeadTimeout(TimeSpan timeout) + T DisableAuditTrail(bool b = true) + T DisableAutomaticProxyDetection(bool disable = true) + T DisableDirectStreaming(bool b = true) + T DisableMetaHeader(bool disable = true) + T DisablePing(bool disable = true) + protected virtual void DisposeManagedResources() + T DnsRefreshTimeout(TimeSpan timeout) + virtual T EnableDebugMode(Action? onRequestCompleted = null) + T EnableHttpCompression(bool enabled = true) + T EnableHttpPipelining(bool enabled = true) + T EnableTcpKeepAlive(TimeSpan keepAliveTime, TimeSpan keepAliveInterval) + T EnableTcpStats(bool enableTcpStats = true) + T EnableThreadPoolStats(bool enableThreadPoolStats = true) + T GlobalHeaders(NameValueCollection headers) + T GlobalQueryStringParameters(NameValueCollection queryStringParameters) + T MaxDeadTimeout(TimeSpan timeout) + T MaxRetryTimeout(TimeSpan maxRetryTimeout) + T MaximumRetries(int maxRetries) + T MemoryStreamFactory(MemoryStreamFactory memoryStreamFactory) + T NodePredicate(Func predicate) + T OnBoundConfigurationCreated(Action handler) + T OnRequestCompleted(Action handler) + virtual T ParseAllHeaders(bool b = true) + T PingTimeout(TimeSpan timeout) + T PipelineProvider(RequestPipelineFactory provider) + virtual T PrettyJson(bool b = true) + T Proxy(Uri proxyAddress, string username, string password) + T Proxy(Uri proxyAddress) + T RequestTimeout(TimeSpan timeout) + T ResponseBuilder(IResponseBuilder responseBuilder) + virtual T ResponseHeadersToParse(HeadersList headersToParse) + T ServerCertificateValidationCallback(Func callback) + T SkipDeserializationForStatusCodes(params int[] statusCodes) + T SniffLifeSpan(TimeSpan? sniffLifeSpan) + T SniffOnConnectionFault(bool sniffsOnConnectionFault = true) + T SniffOnStartup(bool sniffsOnStartup = true) + T ThrowExceptions(bool alwaysThrow = true) + T TransferEncodingChunked(bool transferEncodingChunked = true) + protected T UpdateGlobalQueryString(string key, string value, bool enabled) + T UserAgent(UserAgent userAgent) + + class TransportException : Exception + TransportException(PipelineFailure failure, string message, TransportResponse response) + TransportException(PipelineFailure failure, string message, Exception? innerException = null) + TransportException(string message) + ApiCallDetails? ApiCallDetails { get; } + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + Endpoint? Endpoint { get; } + PipelineFailure? FailureReason { get; } + + static class TransportExtensions + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData, IRequestConfiguration configuration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + static class TransportHttpMethodExtensions + static TResponse Delete(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default) where TResponse : TransportResponse, new() + static TResponse Delete(this ITransport transport, string path, RequestParameters parameters, PostData? data = null) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string path, RequestParameters parameters, PostData? data = null, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string pathAndQuery) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string path, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static VoidResponse Head(this ITransport transport, string pathAndQuery, TimeSpan timeout) + static VoidResponse Head(this ITransport transport, string pathAndQuery) + static VoidResponse Head(this ITransport transport, string path, RequestParameters parameters) + static Task HeadAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string pathAndQuery, TimeSpan timeout, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + abstract class TransportResponse + protected TransportResponse() + [JsonIgnore] + ApiCallDetails ApiCallDetails { get; } + [JsonIgnore] + protected internal virtual bool LeaveOpen { get; } + [JsonIgnore] + protected internal IEnumerable? LinkedDisposables { get; } + override string ToString() + + abstract class TransportResponse : TransportResponse + protected TransportResponse() + T Body { get; protected internal set; } + + class TransportSerializerOptionsProvider : IJsonSerializerOptionsProvider + TransportSerializerOptionsProvider() + TransportSerializerOptionsProvider(IReadOnlyCollection bakedInConverters, IReadOnlyCollection? userProvidedConverters, Action? mutateOptions = null) + JsonSerializerOptions CreateJsonSerializerOptions() + + abstract class TypedResponseBuilder : IResponseBuilder + protected TypedResponseBuilder() + protected abstract TResponse Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) + protected abstract Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) + + class UnexpectedTransportException : TransportException + UnexpectedTransportException(Exception killerException, IReadOnlyCollection? seenExceptions) + IReadOnlyCollection SeenExceptions { get; } + + sealed class UrlFormatter : IFormatProvider, ICustomFormatter + UrlFormatter(ITransportConfiguration settings) + static string CreateString(object? value, ITransportConfiguration settings) + string CreateString(object? value) + string Format(string? format, object? arg, IFormatProvider? formatProvider) + object? GetFormat(Type? formatType) + + sealed class UserAgent + static UserAgent Create(string reposName, Type typeVersionLookup, string[] metadata) + static UserAgent Create(string reposName, Type typeVersionLookup) + static UserAgent Create(string fullUserAgentString) + override string ToString() + + abstract class VersionInfo + protected VersionInfo(SemVersion version) + bool IsPrerelease { get; } + int Major { get; } + string? Metadata { get; } + int Minor { get; } + int Patch { get; } + string? Prerelease { get; } + string ToMetadataHeaderValue() + override string ToString() + + sealed class VoidResponse : TransportResponse + VoidResponse() + static VoidResponse Default { get; } + class VoidBody + VoidBody() + +namespace Elastic.Transport.Diagnostics + static class OpenTelemetry + const string ElasticTransportActivitySourceName = "Elastic.Transport" + static bool ElasticTransportActivitySourceHasListeners { get; } + + class ThreadPoolStatistics + ThreadPoolStatistics(int min, int max, int busy, int free) + int Busy { get; } + int Free { get; } + int Max { get; } + int Min { get; } + + static class ThreadPoolStats + static ReadOnlyDictionary GetStats() + + abstract class TypedDiagnosticObserver : IObserver> + protected TypedDiagnosticObserver(Action> onNextStart, Action> onNextEnd, Action? onError = null, Action? onCompleted = null) + +namespace Elastic.Transport.Diagnostics.Auditing + sealed class Audit + DateTimeOffset Ended { get; } + AuditEvent Event { get; } + Exception? Exception { get; } + Node? Node { get; } + DateTimeOffset Started { get; } + override string ToString() + + enum AuditEvent + SniffOnStartup = 0 + SniffOnFail = 1 + SniffOnStaleCluster = 2 + SniffSuccess = 3 + SniffFailure = 4 + PingSuccess = 5 + PingFailure = 6 + Resurrection = 7 + AllNodesDead = 8 + BadResponse = 9 + HealthyResponse = 10 + MaxTimeoutReached = 11 + MaxRetriesReached = 12 + BadRequest = 13 + NoNodesAttempted = 14 + CancellationRequested = 15 + FailedOverAllNodes = 16 + + class Auditor : IReadOnlyCollection, IEnumerable, IEnumerable + int Count { get; } + void Emit(AuditEvent type, Node node) + void Emit(AuditEvent type) + IEnumerator GetEnumerator() + +namespace Elastic.Transport.Extensions + sealed class SemVersion : IEquatable, IComparable, IComparable + SemVersion(int major, int minor, int patch, string? prerelease, string? metadata) + SemVersion(int major, int minor, int patch, string? prerelease) + SemVersion(int major, int minor, int patch) + int Major { get; } + string Metadata { get; } + int Minor { get; } + int Patch { get; } + string Prerelease { get; } + int CompareByPrecedence(SemVersion? other) + int CompareTo(SemVersion? other) + int CompareTo(object? obj) + bool Equals(SemVersion? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool TryParse(string input, [NotNullWhen(true)] out SemVersion? version) + SemVersion Update(int? major = default, int? minor = default, int? patch = default, string? prerelease = null, string? metadata = null) + static bool operator ==(SemVersion left, SemVersion right) + static bool operator >(SemVersion left, SemVersion right) + static bool operator >=(SemVersion left, SemVersion right) + static bool operator !=(SemVersion left, SemVersion right) + static bool operator <(SemVersion left, SemVersion right) + static bool operator <=(SemVersion left, SemVersion right) + + static class TransportSerializerExtensions + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, string input, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, string input, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, JsonElement node, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, JsonElement node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, JsonNode node, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, JsonNode node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + static bool TryGetJsonSerializerOptions(this Serializer serializer, [NotNullWhen(true)] out JsonSerializerOptions? options, SerializationFormatting formatting = SerializationFormatting.None) + +namespace Elastic.Transport.Products + sealed class DefaultProductRegistration : ProductRegistration + DefaultProductRegistration() + static DefaultProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override HeadersList ResponseHeadersToParse { get; } + override string? ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ProductRegistration + protected ProductRegistration() + abstract string? DefaultContentType { get; } + abstract IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + abstract MetaHeaderProvider MetaHeaderProvider { get; } + abstract string Name { get; } + abstract string ProductAssemblyVersion { get; } + virtual IReadOnlyCollection ResponseBuilders { get; } + abstract HeadersList ResponseHeadersToParse { get; } + abstract string? ServiceIdentifier { get; } + abstract bool SupportsPing { get; } + abstract bool SupportsSniff { get; } + abstract Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + abstract Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + abstract IReadOnlyCollection DefaultHeadersToParse() + abstract bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + virtual bool IsErrorContentType(string? contentType) + virtual bool IsExpectedResponseContentType(string accept, string? responseContentType) + virtual bool IsJsonContentType(string? contentType) + virtual bool IsValidResponse(ApiCallDetails? details) + abstract bool NodePredicate(Node node) + abstract Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + abstract TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract int SniffOrder(Node node) + virtual string? TransformContentType(string? contentType) + virtual ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + abstract bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + +namespace Elastic.Transport.Products.Elasticsearch + record ElasticsearchConfiguration : TransportConfiguration, IEquatable + protected ElasticsearchConfiguration(ElasticsearchConfiguration original) + ElasticsearchConfiguration(string cloudId, ApiKey credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, ApiKey credentials) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, ApiKey credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri? uri = null) + protected override Type EqualityContract { get; } + override TransportConfiguration $() + virtual bool Equals(ElasticsearchConfiguration? other) + sealed override bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected override bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + static bool operator !=(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + + sealed class ElasticsearchDynamicResponse : DynamicResponseBase, IElasticsearchResponse + ElasticsearchDynamicResponse() + ElasticsearchDynamicResponse(DynamicDictionary dictionary) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchErrorExtensions + static bool TryGetElasticsearchServerError(this BytesResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this StringResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this TransportResponse response, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchJsonResponse : JsonResponseBase, IElasticsearchResponse + ElasticsearchJsonResponse() + ElasticsearchJsonResponse(JsonNode node) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchNodeFeatures + static readonly IReadOnlyCollection Default + const string HoldsData = "node.data" + const string HttpEnabled = "node.http" + const string IngestEnabled = "node.ingest" + const string MasterEligible = "node.master" + static readonly IReadOnlyCollection MasterEligibleOnly + static readonly IReadOnlyCollection NotMasterEligible + + class ElasticsearchProductRegistration : ProductRegistration + ElasticsearchProductRegistration(Type markerType) + const string SniffPath = "_nodes/http,settings" + static ProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override IReadOnlyCollection ResponseBuilders { get; } + override HeadersList ResponseHeadersToParse { get; } + sealed override string ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool IsErrorContentType(string? contentType) + override bool IsExpectedResponseContentType(string accept, string? responseContentType) + override bool IsJsonContentType(string? contentType) + override bool IsValidResponse(ApiCallDetails? details) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override string? TransformContentType(string? contentType) + override ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ElasticsearchResponse : TransportResponse, IElasticsearchResponse + protected ElasticsearchResponse() + [JsonIgnore] + string DebugInformation { get; } + [JsonIgnore] + ElasticsearchServerError? ElasticsearchServerError { get; } + [JsonIgnore] + IEnumerable ElasticsearchWarnings { get; } + [JsonIgnore] + virtual bool IsValidResponse { get; } + protected virtual void DebugIsValid(StringBuilder sb) + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ElasticsearchServerError : ErrorResponse + ElasticsearchServerError() + ElasticsearchServerError(Error error, int? statusCode) + [DataMember(Name = "error")] + [JsonPropertyName("error")] + Error? Error { get; init; } + [DataMember(Name = "status")] + [JsonPropertyName("status")] + int Status { get; init; } + static ElasticsearchServerError Create(Stream stream) + static ValueTask CreateAsync(Stream stream, CancellationToken token = default) + override bool HasError() + override string ToString() + static bool TryCreate(Stream stream, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchStreamResponse : StreamResponseBase, IElasticsearchResponse + ElasticsearchStreamResponse() + ElasticsearchStreamResponse(Stream body, string? contentType) + Stream Body { get; } + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + sealed class ElasticsearchStringResponse : StringResponseBase, IElasticsearchResponse + ElasticsearchStringResponse() + ElasticsearchStringResponse(string body) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.13.2411")] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ErrorCause))] + [JsonSerializable(typeof(System.Collections.Generic.Dictionary`2[[System.String, netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51],[System.Object, netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]], netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyCollection`1[Elastic.Transport.Products.Elasticsearch.ErrorCause], netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyDictionary`2[[System.String, netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51],[System.String, netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]], netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51))] + [JsonSerializable(typeof(System.Object[], netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51))] + [JsonSerializable(typeof(System.String))] + [JsonSerializable(typeof(System.Text.Json.JsonElement))] + [JsonSourceGenerationOptions(GenerationMode = (JsonSourceGenerationMode)0, UseStringEnumConverter = true)] + class ElasticsearchTransportSerializerContext : JsonSerializerContext, IJsonTypeInfoResolver + ElasticsearchTransportSerializerContext() + ElasticsearchTransportSerializerContext(JsonSerializerOptions options) + static ElasticsearchTransportSerializerContext Default { get; } + JsonTypeInfo> DictionaryStringObject { get; } + JsonTypeInfo ElasticsearchResponse { get; } + JsonTypeInfo ElasticsearchServerError { get; } + JsonTypeInfo Error { get; } + JsonTypeInfo ErrorCause { get; } + protected override JsonSerializerOptions? GeneratedSerializerOptions { get; } + JsonTypeInfo> IReadOnlyCollectionErrorCause { get; } + JsonTypeInfo> IReadOnlyDictionaryStringString { get; } + JsonTypeInfo Int32 { get; } + JsonTypeInfo JsonElement { get; } + JsonTypeInfo Object { get; } + JsonTypeInfo ObjectArray { get; } + JsonTypeInfo String { get; } + override JsonTypeInfo? GetTypeInfo(Type type) + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.Products.Elasticsearch.ErrorConverter))] + sealed class Error : ErrorCause + Error() + [JsonPropertyName("headers")] + IReadOnlyDictionary Headers { get; set; } + [JsonPropertyName("root_cause")] + IReadOnlyCollection? RootCause { get; set; } + override string ToString() + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.ErrorCauseConverter))] + class ErrorCause + ErrorCause() + IReadOnlyDictionary AdditionalProperties { get; } + ErrorCause? CausedBy { get; } + string? Index { get; } + string? IndexUUID { get; } + string? Reason { get; } + [JsonPropertyName("stack_trace")] + string? StackTrace { get; } + string? Type { get; } + override string ToString() + + sealed class ErrorConverter : JsonConverter + ErrorConverter() + override Error? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + override void Write(Utf8JsonWriter writer, Error value, JsonSerializerOptions options) + + interface IElasticsearchResponse + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ShardFailure + ShardFailure() + [JsonPropertyName("index")] + string? Index { get; set; } + [JsonPropertyName("node")] + string? Node { get; set; } + [JsonPropertyName("reason")] + ErrorCause? Reason { get; set; } + [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] + [JsonPropertyName("shard")] + int? Shard { get; set; } + [JsonPropertyName("status")] + string? Status { get; set; } + + static class SniffParser + static Regex AddressRegex { get; } + static Uri ParseToUri(string boundAddress, bool forceHttp) diff --git a/api/Elastic.Transport.netstandard2.1.api b/api/Elastic.Transport.netstandard2.1.api new file mode 100644 index 00000000..a63d937b --- /dev/null +++ b/api/Elastic.Transport.netstandard2.1.api @@ -0,0 +1,1508 @@ +assembly Elastic.Transport +using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri +using struct System: DateTime, DateTimeOffset, Guid, ReadOnlyMemory<>, ReadOnlySpan<>, TimeSpan, TypeCode +using interface System: IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> +using System.CodeDom.Compiler: GeneratedCodeAttribute +using interface System.Collections: IEnumerable +using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> +using struct System.Collections.Generic: KeyValuePair<,> +using interface System.Collections.Generic: ICollection<>, IDictionary<,>, IEnumerable<>, IReadOnlyCollection<> +using System.Collections.ObjectModel: ReadOnlyDictionary<,> +using System.Collections.Specialized: NameValueCollection +using System.ComponentModel: BrowsableAttribute, EditorBrowsableAttribute +using System.Diagnostics: Activity +using System.Diagnostics.CodeAnalysis: NotNullWhenAttribute +using System.Dynamic: BinaryOperationBinder, ConvertBinder, DynamicObject, GetMemberBinder, SetMemberBinder +using System.IO: MemoryStream, Stream +using System.Linq: IOrderedEnumerable<> +using System.Net: HttpWebRequest, ServicePoint +using System.Net.Http: HttpMessageHandler +using struct System.Net.NetworkInformation: TcpState +using struct System.Net.Security: SslPolicyErrors +using System.Runtime.Serialization: DataContractAttribute, DataMemberAttribute, EnumMemberAttribute +using System.Security.Cryptography.X509Certificates: X509Certificate, X509CertificateCollection, X509Chain +using struct System.Security.Cryptography.X509Certificates: X509RevocationMode +using System.Text: StringBuilder +using System.Text.Json: JsonSerializerOptions, Utf8JsonWriter +using struct System.Text.Json: JsonElement, Utf8JsonReader +using System.Text.Json.Nodes: JsonNode +using System.Text.Json.Serialization: JsonConverter, JsonConverter<>, JsonConverterAttribute, JsonIgnoreAttribute, JsonNumberHandlingAttribute, JsonPropertyNameAttribute, JsonSerializableAttribute, JsonSerializerContext, JsonSourceGenerationOptionsAttribute +using System.Text.Json.Serialization.Metadata: JsonTypeInfo, JsonTypeInfo<> +using interface System.Text.Json.Serialization.Metadata: IJsonTypeInfoResolver +using System.Text.RegularExpressions: Regex +using System.Threading: SemaphoreSlim +using struct System.Threading: CancellationToken +using System.Threading.Tasks: Task, Task<> +using struct System.Threading.Tasks: ValueTask, ValueTask<> + +namespace Elastic.Transport + sealed class ApiCallDetails + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + bool HasExpectedContentType { get; } + bool HasSuccessfulStatusCode { get; } + HttpMethod HttpMethod { get; } + int? HttpStatusCode { get; } + Exception? OriginalException { get; } + ErrorResponse? ProductError { get; } + byte[]? RequestBodyInBytes { get; } + byte[]? ResponseBodyInBytes { get; } + string ResponseContentType { get; set; } + [Obsolete("This property has been retired and replaced by ResponseContentType. Prefer using the updated property as this will be removed in a future release.")] + string ResponseMimeType { get; set; } + Uri? Uri { get; } + override string ToString() + bool TryGetHeader(string key, [NotNullWhen(true)] out IEnumerable? headerValues) + + class ApiKey : AuthorizationHeader + ApiKey(string apiKey) + override string AuthScheme { get; } + override bool TryGetAuthorizationParameters(out string value) + + abstract class AuthorizationHeader + protected AuthorizationHeader() + abstract string AuthScheme { get; } + abstract bool TryGetAuthorizationParameters(out string value) + + class Base64ApiKey : ApiKey + Base64ApiKey(string id, string apiKey) + Base64ApiKey(string base64EncodedApiKey) + + sealed class BasicAuthentication : AuthorizationHeader + BasicAuthentication(string username, string password) + override string AuthScheme { get; } + static string BasicAuthenticationScheme { get; } + static string GetBase64String(string header) + override bool TryGetAuthorizationParameters(out string value) + + sealed record BoundConfiguration : IRequestConfiguration, IEquatable + BoundConfiguration(ITransportConfiguration global, IRequestConfiguration? local = null) + const string DefaultContentType = "application/json" + const string RunAsSecurityHeader = "es-security-runas-user" + string Accept { get; } + IReadOnlyCollection AllowedStatusCodes { get; } + AuthorizationHeader? AuthenticationHeader { get; } + X509CertificateCollection? ClientCertificates { get; } + ITransportConfiguration ConnectionSettings { get; } + string ContentType { get; } + bool DisableAuditTrail { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableDirectStreaming { get; } + bool DisablePings { get; } + bool DisableSniff { get; } + TimeSpan DnsRefreshTimeout { get; } + bool EnableTcpStats { get; } + bool EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool HttpCompression { get; } + bool HttpPipeliningEnabled { get; } + int KeepAliveInterval { get; } + int KeepAliveTime { get; } + int MaxRetries { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + string? OpaqueId { get; } + bool ParseAllHeaders { get; } + TimeSpan PingTimeout { get; } + IReadOnlyCollection ProductResponseBuilders { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + IReadOnlyCollection SkipDeserializationForStatusCodes { get; } + bool ThrowExceptions { get; } + bool TransferEncodingChunked { get; } + UserAgent UserAgent { get; } + BoundConfiguration $() + static BoundConfiguration Create(ITransport transport, IRequestConfiguration requestConfiguration) + bool Equals(BoundConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool operator ==(BoundConfiguration? left, BoundConfiguration? right) + static bool operator !=(BoundConfiguration? left, BoundConfiguration? right) + + sealed class BytesResponse : TransportResponse + BytesResponse() + BytesResponse(byte[] body) + + static class CertificateValidations + static bool AllowAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + static Func AuthorityIsRoot(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static Func AuthorityPartOfChain(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static bool DenyAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + + sealed class CloudNodePool : SingleNodePool + CloudNodePool(string cloudId, AuthorizationHeader credentials, CloudService service) + CloudNodePool(string cloudId, AuthorizationHeader credentials) + CloudNodePool(Uri cloudEndpoint, AuthorizationHeader credentials) + AuthorizationHeader AuthenticationHeader { get; } + + enum CloudService + Elasticsearch = 0 + Kibana = 1 + + abstract class DateTimeProvider + abstract DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + abstract DateTimeOffset Now() + + sealed class DefaultDateTimeProvider : DateTimeProvider + DefaultDateTimeProvider() + static readonly DefaultDateTimeProvider Default + override DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + override DateTimeOffset Now() + + sealed class DefaultMemoryStreamFactory : MemoryStreamFactory + DefaultMemoryStreamFactory() + static DefaultMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class DefaultMetaHeaderProducer : MetaHeaderProducer + DefaultMetaHeaderProducer(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProducer(Type clientType, string serviceIdentifier) + override string HeaderName { get; } + override string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + sealed class DefaultMetaHeaderProvider : MetaHeaderProvider + DefaultMetaHeaderProvider(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProvider(Type clientType, string serviceIdentifier) + override MetaHeaderProducer[] Producers { get; } + + sealed class DefaultRequestParameters : RequestParameters + DefaultRequestParameters() + + sealed class DistributedTransport : DistributedTransport + DistributedTransport(ITransportConfiguration configuration) + + class DistributedTransport : ITransport, ITransport where TConfiguration : class, ITransportConfiguration + DistributedTransport(TConfiguration configuration) + TConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + sealed class DynamicDictionary : DynamicObject, IEquatable, IDictionary, ICollection>, IEnumerable>, IEnumerable + DynamicDictionary() + int Count { get; } + static DynamicDictionary Empty { get; } + bool IsReadOnly { get; } + DynamicValue this[string name] { get; set; } + ICollection Keys { get; } + ICollection Values { get; } + void Add(KeyValuePair item) + void Add(string key, DynamicValue value) + void Clear() + bool Contains(KeyValuePair item) + bool ContainsKey(string key) + void CopyTo(KeyValuePair[] array, int arrayIndex) + static DynamicDictionary Create(IDictionary values) + static DynamicDictionary Create(JsonElement e) + bool Equals(DynamicDictionary? other) + override bool Equals(object? obj) + T Get(string? path) + override IEnumerable GetDynamicMemberNames() + override int GetHashCode() + bool Remove(KeyValuePair item) + bool Remove(string key) + Dictionary ToDictionary() + override bool TryGetMember(GetMemberBinder binder, out object result) + bool TryGetValue(string key, out DynamicValue value) + override bool TrySetMember(SetMemberBinder binder, object? value) + + sealed class DynamicResponse : DynamicResponseBase + DynamicResponse() + DynamicResponse(DynamicDictionary dictionary) + + abstract class DynamicResponseBase : TransportResponse + protected DynamicResponseBase() + protected DynamicResponseBase(DynamicDictionary dictionary) + T Get(string path) + + sealed class DynamicValue : DynamicObject, IEquatable, IConvertible, IReadOnlyCollection, IEnumerable, IEnumerable + DynamicValue(object? value) + int Count { get; } + bool HasValue { get; } + DynamicValue this[int i] { get; } + DynamicValue this[string name] { get; } + static DynamicValue NullValue { get; } + object? Value { get; } + static object? ConsumeJsonElement(Type targetReturnType, JsonElement e) + T? Default(T? defaultValue = null) + bool Equals(DynamicValue? compareValue) + override bool Equals(object? obj) + T? Get(string path) + IEnumerator GetEnumerator() + override int GetHashCode() + TypeCode GetTypeCode() + static DynamicValue SelfOrNew(object v) + bool ToBoolean(IFormatProvider? provider) + byte ToByte(IFormatProvider? provider) + char ToChar(IFormatProvider? provider) + DateTime ToDateTime(IFormatProvider? provider) + decimal ToDecimal(IFormatProvider? provider) + IDictionary? ToDictionary() + double ToDouble(IFormatProvider? provider) + IEnumerable ToEnumerable() + short ToInt16(IFormatProvider? provider) + int ToInt32(IFormatProvider? provider) + long ToInt64(IFormatProvider? provider) + [CLSCompliant(false)] + sbyte ToSByte(IFormatProvider? provider) + float ToSingle(IFormatProvider? provider) + override string? ToString() + string ToString(IFormatProvider? provider) + object ToType(Type conversionType, IFormatProvider? provider) + [CLSCompliant(false)] + ushort ToUInt16(IFormatProvider? provider) + [CLSCompliant(false)] + uint ToUInt32(IFormatProvider? provider) + [CLSCompliant(false)] + ulong ToUInt64(IFormatProvider? provider) + override bool TryBinaryOperation(BinaryOperationBinder binder, object arg, out object? result) + override bool TryConvert(ConvertBinder binder, out object? result) + override bool TryGetMember(GetMemberBinder binder, out object? result) + T? TryParse(T? defaultValue = null) + static bool operator ==(DynamicValue dynamicValue, object compareValue) + static bool operator !=(DynamicValue dynamicValue, object compareValue) + static implicit operator bool(DynamicValue dynamicValue) + static implicit operator string?(DynamicValue dynamicValue) + static implicit operator int(DynamicValue dynamicValue) + static implicit operator Guid(DynamicValue dynamicValue) + static implicit operator DateTime(DynamicValue dynamicValue) + static implicit operator DateTimeOffset(DynamicValue dynamicValue) + static implicit operator TimeSpan(DynamicValue dynamicValue) + static implicit operator long(DynamicValue dynamicValue) + static implicit operator float(DynamicValue dynamicValue) + static implicit operator decimal(DynamicValue dynamicValue) + static implicit operator double(DynamicValue dynamicValue) + + record Endpoint : IEquatable + Endpoint(in EndpointPath Path, Node Node) + protected Endpoint(Endpoint original) + protected virtual Type EqualityContract { get; } + bool IsEmpty { get; } + HttpMethod Method { get; } + Node Node { get; init; } + EndpointPath Path { get; init; } + string PathAndQuery { get; } + Uri Uri { get; } + virtual Endpoint $() + void Deconstruct(out EndpointPath Path, out Node Node) + static Endpoint Empty(in EndpointPath path) + virtual bool Equals(Endpoint? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(Endpoint? left, Endpoint? right) + static bool operator !=(Endpoint? left, Endpoint? right) + + readonly struct EndpointPath : IEquatable + EndpointPath(HttpMethod Method, string PathAndQuery) + HttpMethod Method { get; init; } + string PathAndQuery { get; init; } + void Deconstruct(out HttpMethod Method, out string PathAndQuery) + bool Equals(EndpointPath other) + override bool Equals(object obj) + override int GetHashCode() + override string ToString() + static bool operator ==(EndpointPath left, EndpointPath right) + static bool operator !=(EndpointPath left, EndpointPath right) + + class ErrorCauseConverter : ErrorCauseConverter + ErrorCauseConverter() + + abstract class ErrorCauseConverter : JsonConverter where TErrorCause : ErrorCause, new() + protected ErrorCauseConverter() + override TErrorCause? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + protected virtual bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, TErrorCause errorCause) + override void Write(Utf8JsonWriter writer, TErrorCause value, JsonSerializerOptions options) + + class ErrorConverter : ErrorCauseConverter + ErrorConverter() + protected override bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, Error errorCause) + + abstract class ErrorResponse + abstract bool HasError() + + readonly struct HeadersList : IEnumerable, IEnumerable + HeadersList(IEnumerable headers, IEnumerable otherHeaders) + HeadersList(IEnumerable headers, string additionalHeader) + HeadersList(IEnumerable headers) + HeadersList(HeadersList? headers, HeadersList? otherHeaders) + HeadersList(string header) + int Count { get; } + IEnumerator GetEnumerator() + + enum HttpMethod + [EnumMember(Value = "GET")] + GET = 0 + [EnumMember(Value = "POST")] + POST = 1 + [EnumMember(Value = "PUT")] + PUT = 2 + [EnumMember(Value = "DELETE")] + DELETE = 3 + [EnumMember(Value = "HEAD")] + HEAD = 4 + + static class HttpMethodExtensions + static string GetStringValue(this HttpMethod httpMethod) + + class HttpRequestInvoker : IRequestInvoker, IDisposable + HttpRequestInvoker() + HttpRequestInvoker(Func wrappingHandler) + int InUseHandlers { get; } + int RemovedHandlers { get; } + ResponseFactory ResponseFactory { get; } + protected HttpMessageHandler CreateHttpClientHandler(BoundConfiguration boundConfiguration) + void Dispose() + virtual void DisposeManagedResources() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + [Obsolete("CoreFX HttpWebRequest uses HttpClient under the covers but does not reuse HttpClient instances, do NOT use on .NET core only used as the default on Full Framework")] + class HttpWebRequestInvoker : IRequestInvoker, IDisposable + HttpWebRequestInvoker() + ResponseFactory ResponseFactory { get; } + protected virtual void AlterServicePoint(ServicePoint requestServicePoint, BoundConfiguration boundConfiguration) + protected virtual HttpWebRequest CreateHttpWebRequest(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, bool isAsync) + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected virtual void SetAuthenticationIfNeeded(Endpoint endpoint, BoundConfiguration boundConfiguration, HttpWebRequest request) + protected virtual void SetClientCertificates(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetProxyIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetServerCertificateValidationCallBackIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + + interface IJsonSerializerOptionsProvider + JsonSerializerOptions CreateJsonSerializerOptions() + + interface IRequestConfiguration + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; } + AuthorizationHeader? Authentication { get; } + X509CertificateCollection? ClientCertificates { get; } + string? ContentType { get; } + bool? DisableAuditTrail { get; } + bool? DisableDirectStreaming { get; } + bool? DisablePings { get; } + bool? DisableSniff { get; } + bool? EnableHttpCompression { get; } + bool? EnableTcpStats { get; } + bool? EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool? HttpPipeliningEnabled { get; } + int? MaxRetries { get; } + TimeSpan? MaxRetryTimeout { get; } + string? OpaqueId { get; } + bool? ParseAllHeaders { get; } + TimeSpan? PingTimeout { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan? RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + bool? ThrowExceptions { get; } + bool? TransferEncodingChunked { get; } + UserAgent? UserAgent { get; } + + interface IRequestInvoker : IDisposable + ResponseFactory ResponseFactory { get; } + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + interface IResponseBuilder + TResponse? Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) where TResponse : TransportResponse, new() + Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + bool CanBuild() where TResponse : TransportResponse, new() + + interface IStringable + string GetString() + + interface ITransport + ITransportConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + interface ITransportConfiguration : IRequestConfiguration, IDisposable + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; } + int ConnectionLimit { get; } + DateTimeProvider? DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableMetaHeader { get; } + TimeSpan DnsRefreshTimeout { get; } + TimeSpan? KeepAliveInterval { get; } + TimeSpan? KeepAliveTime { get; } + TimeSpan? MaxDeadTimeout { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + NodePool NodePool { get; } + Func? NodePredicate { get; } + Action? OnConfigurationBound { get; } + Action? OnRequestCompleted { get; } + RequestPipelineFactory? PipelineProvider { get; } + bool PrettyJson { get; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + NameValueCollection? QueryStringParameters { get; } + IRequestInvoker RequestInvoker { get; } + Serializer RequestResponseSerializer { get; } + Func? ServerCertificateValidationCallback { get; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; } + TimeSpan? SniffInformationLifeSpan { get; } + bool SniffsOnConnectionFault { get; } + bool SniffsOnStartup { get; } + Func StatusCodeToResponseSuccess { get; } + UrlFormatter UrlFormatter { get; } + + interface ITransport : ITransport where TConfiguration : class, ITransportConfiguration + TConfiguration Configuration { get; } + + interface IUrlParameter + string GetString(ITransportConfiguration settings) + + class InMemoryRequestInvoker : IRequestInvoker, IDisposable + InMemoryRequestInvoker() + InMemoryRequestInvoker(byte[]? responseBody, int statusCode = 200, Exception? exception = null, string contentType = "application/json", Dictionary>? headers = null) + ResponseFactory ResponseFactory { get; } + TResponse BuildResponse(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + Task BuildResponseAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + sealed class JsonResponse : JsonResponseBase + JsonResponse() + JsonResponse(JsonNode node) + + abstract class JsonResponseBase : TransportResponse + protected JsonResponseBase() + protected JsonResponseBase(JsonNode node) + T Get(string path) + + abstract class MemoryStreamFactory + protected MemoryStreamFactory() + abstract MemoryStream Create() + abstract MemoryStream Create(byte[] bytes, int index, int count) + abstract MemoryStream Create(byte[] bytes) + + sealed class MetaDataHeader + MetaDataHeader(VersionInfo version, string serviceIdentifier, bool isAsync) + string ClientVersion { get; } + string RuntimeVersion { get; } + string ServiceIdentifier { get; } + string? TransportVersion { get; } + override string ToString() + + abstract class MetaHeaderProducer + protected MetaHeaderProducer() + abstract string HeaderName { get; } + abstract string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + abstract class MetaHeaderProvider + protected MetaHeaderProvider() + abstract MetaHeaderProducer[] Producers { get; } + + sealed class Node : IEquatable + Node(Uri uri, IEnumerable? features = null) + DateTimeOffset DeadUntil { get; } + int FailedAttempts { get; } + IReadOnlyCollection Features { get; set; } + string? Id { get; } + bool IsAlive { get; } + bool IsResurrected { get; set; } + string? Name { get; set; } + IReadOnlyDictionary Settings { get; set; } + Uri Uri { get; } + Node Clone() + Uri CreatePath(string path) + bool Equals(Node? other) + override bool Equals(object? obj) + override int GetHashCode() + bool HasFeature(string feature) + void MarkAlive() + void MarkDead(DateTimeOffset until) + static bool operator ==(Node left, Node right) + static bool operator !=(Node left, Node right) + static implicit operator Node(Uri uri) + + abstract class NodePool : IDisposable + protected NodePool() + DateTimeProvider DateTimeProvider { get; set; } + abstract DateTimeOffset? LastUpdate { get; protected set; } + abstract int MaxRetries { get; } + abstract IReadOnlyCollection Nodes { get; } + bool SniffedOnStartup { get; } + abstract bool SupportsPinging { get; } + abstract bool SupportsReseeding { get; } + bool UsingSsl { get; protected set; } + abstract IEnumerable CreateView(Auditor? auditor = null) + void Dispose() + protected virtual void Dispose(bool disposing) + void MarkAsSniffed() + abstract void Reseed(IEnumerable nodes) + + class PipelineException : Exception + PipelineException(PipelineFailure failure, Exception? innerException) + PipelineException(PipelineFailure failure) + PipelineFailure FailureReason { get; } + bool Recoverable { get; } + TransportResponse? Response { get; } + + enum PipelineFailure + BadAuthentication = 0 + BadResponse = 1 + PingFailure = 2 + SniffFailure = 3 + CouldNotStartSniffOnStartup = 4 + MaxTimeoutReached = 5 + MaxRetriesReached = 6 + Unexpected = 7 + BadRequest = 8 + NoNodesAttempted = 9 + + abstract class PostData + protected PostData() + protected const int BufferSize = 81920 + protected static readonly byte[] NewLineByteArray + static PostData Empty { get; } + PostType Type { get; } + byte[]? WrittenBytes { get; } + protected void BufferIfNeeded(MemoryStreamFactory memoryStreamFactory, bool disableDirectStreaming, ref MemoryStream? buffer, ref Stream stream) + static PostData Bytes(byte[] bytes) + protected void FinishStream(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming) + protected ValueTask FinishStreamAsync(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming, CancellationToken ctx) + static PostData MultiJson(IEnumerable listOfSerializables) + static PostData MultiJson(IEnumerable listOfString) + static PostData ReadOnlyMemory(ReadOnlyMemory bytes) + static PostData Serializable(T data) + static PostData StreamHandler(T state, Action syncWriter, Func asyncWriter) + static PostData String(string serializedString) + abstract void Write(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming) + abstract Task WriteAsync(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming, CancellationToken cancellationToken) + static implicit operator PostData(byte[] byteArray) + static implicit operator PostData(string literalString) + + enum PostType + ByteArray = 0 + ReadOnlyMemory = 1 + LiteralString = 2 + Serializable = 3 + EnumerableOfString = 4 + EnumerableOfObject = 5 + StreamHandler = 6 + + sealed class RecyclableMemoryStreamFactory : MemoryStreamFactory + RecyclableMemoryStreamFactory() + static RecyclableMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class ReflectionVersionInfo : VersionInfo + static readonly string TransportVersion + static ReflectionVersionInfo Create() + static ReflectionVersionInfo Create(Type type) + + record RequestConfiguration : IRequestConfiguration, IEquatable + RequestConfiguration() + RequestConfiguration(IRequestConfiguration config) + protected RequestConfiguration(RequestConfiguration original) + static readonly TimeSpan DefaultPingTimeout + static readonly TimeSpan DefaultPingTimeoutOnSsl + static readonly TimeSpan DefaultRequestTimeout + static readonly UserAgent DefaultUserAgent + string? Accept { get; init; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + string? ContentType { get; init; } + bool? DisableAuditTrail { get; init; } + bool? DisableDirectStreaming { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestMetaData? RequestMetaData { get; init; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UserAgent? UserAgent { get; init; } + virtual RequestConfiguration $() + virtual bool Equals(RequestConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(RequestConfiguration? left, RequestConfiguration? right) + static bool operator !=(RequestConfiguration? left, RequestConfiguration? right) + + class RequestConfigurationDescriptor : IRequestConfiguration + RequestConfigurationDescriptor() + RequestConfigurationDescriptor(IRequestConfiguration config) + RequestConfigurationDescriptor Accept(string acceptHeader) + RequestConfigurationDescriptor AllowedStatusCodes(IEnumerable? codes) + RequestConfigurationDescriptor AllowedStatusCodes(params int[] codes) + RequestConfigurationDescriptor Authentication(AuthorizationHeader authentication) + RequestConfigurationDescriptor ClientCertificate(X509Certificate certificate) + RequestConfigurationDescriptor ClientCertificate(string certificatePath) + RequestConfigurationDescriptor ClientCertificates(X509CertificateCollection certificates) + RequestConfigurationDescriptor ContentType(string contentTypeHeader) + RequestConfigurationDescriptor DisableAuditTrail(bool disable = true) + RequestConfigurationDescriptor DisableDirectStreaming(bool disable = true) + RequestConfigurationDescriptor DisablePing(bool disable = true) + RequestConfigurationDescriptor DisableSniffing(bool disable = true) + RequestConfigurationDescriptor EnableHttpCompression(bool enable = true) + RequestConfigurationDescriptor EnableHttpPipelining(bool enable = true) + RequestConfigurationDescriptor EnableTcpStats(bool enableTcpStats = true) + RequestConfigurationDescriptor EnableThreadPoolStats(bool enableThreadPoolStats = true) + RequestConfigurationDescriptor ForceNode(Uri uri) + RequestConfigurationDescriptor GlobalHeaders(NameValueCollection headers) + RequestConfigurationDescriptor MaxRetries(int retry) + RequestConfigurationDescriptor MaxRetries(TimeSpan? timeout) + RequestConfigurationDescriptor OpaqueId(string opaqueId) + RequestConfigurationDescriptor ParseAllHeaders(bool enable = true) + RequestConfigurationDescriptor PingTimeout(TimeSpan pingTimeout) + RequestConfigurationDescriptor RequestMetaData(RequestMetaData metaData) + RequestConfigurationDescriptor RequestTimeout(TimeSpan requestTimeout) + RequestConfigurationDescriptor ResponseBuilder(IResponseBuilder responseBuilder) + RequestConfigurationDescriptor ResponseHeadersToParse(IEnumerable headers) + RequestConfigurationDescriptor RunAs(string username) + RequestConfigurationDescriptor ThrowExceptions(bool throwExceptions = true) + RequestConfigurationDescriptor TransferEncodingChunked(bool transferEncodingChunked = true) + RequestConfigurationDescriptor UserAgent(UserAgent userAgent) + + sealed class RequestMetaData + RequestMetaData() + IReadOnlyDictionary? Items { get; } + + static class RequestMetaDataExtensions + static void AddHelper(this RequestMetaData metaData, string helperValue) + + abstract class RequestParameters + protected RequestParameters() + Dictionary QueryString { get; } + string? AcceptHeaderFromFormat(string? format) + bool ContainsQueryString(string name) + virtual string CreatePathWithQueryStrings(string? path, ITransportConfiguration? globalConfig) + TOut? GetQueryStringValue(string name) + protected void Q(string name, IStringable value) + protected void Q(string name, object value) + protected TOut? Q(string name) + void SetQueryString(string name, object? value) + + class RequestPipeline + void AuditCancellationRequested(Auditor? auditor) + void BadResponse(ref TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, TransportException exception, IReadOnlyCollection? auditTrail) where TResponse : TransportResponse, new() + TResponse CallProductEndpoint(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor) where TResponse : TransportResponse, new() + Task CallProductEndpointAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + TransportException? CreateClientException(TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, Auditor? auditor, DateTimeOffset startedOn, int attemptedNodes, List? seenExceptions) where TResponse : TransportResponse, new() + void FirstPoolUsage(SemaphoreSlim semaphore, Auditor? auditor) + Task FirstPoolUsageAsync(SemaphoreSlim semaphore, Auditor? auditor, CancellationToken cancellationToken) + void MarkAlive(Node node) + void MarkDead(Node node) + IEnumerable NextNode(DateTimeOffset startedOn, int attemptedNodes, Auditor? auditor) + void Ping(Node node, Auditor? auditor) + Task PingAsync(Node node, Auditor? auditor, CancellationToken cancellationToken = default) + void Sniff(Auditor? auditor) + Task SniffAsync(Auditor? auditor, CancellationToken cancellationToken = default) + void SniffOnConnectionFailure(Auditor? auditor) + Task SniffOnConnectionFailureAsync(Auditor? auditor, CancellationToken cancellationToken) + void SniffOnStaleCluster(Auditor? auditor) + Task SniffOnStaleClusterAsync(Auditor? auditor, CancellationToken cancellationToken) + void ThrowNoNodesAttempted(Endpoint endpoint, Auditor? auditor, List? seenExceptions) + bool TryGetSingleNode(out Node? node) + + abstract class RequestPipelineFactory + abstract RequestPipeline Create(BoundConfiguration boundConfiguration) + + abstract class ResponseFactory + protected ResponseFactory() + abstract TResponse Create(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream? responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats) where TResponse : TransportResponse, new() + abstract Task CreateAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected static bool MayHaveBody(int? statusCode, HttpMethod httpMethod, long contentLength) + + enum SerializationFormatting + None = 0 + Indented = 1 + + abstract class Serializer + protected Serializer() + abstract T Deserialize(Stream stream) + abstract object? Deserialize(Type type, Stream stream) + abstract ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + abstract ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + abstract void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + abstract void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + + sealed class SerializerRegistrationInformation + SerializerRegistrationInformation(Type type, string purpose) + string Purpose { get; } + Type TypeInformation { get; } + override string ToString() + + class SingleNodePool : NodePool + SingleNodePool(Uri uri) + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + + class SniffingNodePool : StaticNodePool + SniffingNodePool(IEnumerable nodes, bool randomize = true) + SniffingNodePool(IEnumerable nodes, Func nodeScorer) + SniffingNodePool(IEnumerable uris, bool randomize = true) + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + protected override void Dispose(bool disposing) + override void Reseed(IEnumerable nodes) + + class StaticNodePool : NodePool + protected StaticNodePool(IEnumerable nodes, bool randomize, int? randomizeSeed = default) + StaticNodePool(IEnumerable nodes, bool randomize = true) + protected StaticNodePool(IEnumerable nodes, Func? nodeScorer = null) + StaticNodePool(IEnumerable uris, bool randomize = true) + protected IReadOnlyList AliveNodes { get; } + protected ref int GlobalCursor { get; } + protected List InternalNodes { get; set; } + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + protected Random Random { get; } + protected bool Randomize { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + protected Node RetryInternalNodes(int globalCursor, Auditor? auditor = null) + protected static IEnumerable SelectAliveNodes(int cursor, IReadOnlyList aliveNodes, Auditor? auditor = null) + protected IOrderedEnumerable SortNodes(IEnumerable nodes) + + sealed class StickyNodePool : StaticNodePool + StickyNodePool(IEnumerable nodes) + StickyNodePool(IEnumerable uris) + override IEnumerable CreateView(Auditor? auditor) + override void Reseed(IEnumerable nodes) + + sealed class StickySniffingNodePool : SniffingNodePool + StickySniffingNodePool(IEnumerable nodes, Func? nodeScorer = null) + StickySniffingNodePool(IEnumerable uris, Func? nodeScorer = null) + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + + sealed class StreamResponse : StreamResponseBase, IDisposable + StreamResponse() + StreamResponse(Stream body, string? contentType) + Stream Body { get; } + + abstract class StreamResponseBase : TransportResponse, IDisposable + protected StreamResponseBase(Stream responseStream, string? contentType = null) + string ContentType { get; } + protected bool Disposed { get; } + protected internal override bool LeaveOpen { get; } + protected Stream Stream { get; } + void Dispose() + protected virtual void Dispose(bool disposing) + + sealed class StringResponse : StringResponseBase + StringResponse() + StringResponse(string body) + + abstract class StringResponseBase : TransportResponse + protected StringResponseBase() + protected StringResponseBase(string body) + + abstract class SystemTextJsonSerializer : Serializer + protected SystemTextJsonSerializer(IJsonSerializerOptionsProvider? provider = null) + override T Deserialize(Stream stream) + override object? Deserialize(Type type, Stream stream) + override ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + override ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + protected internal JsonSerializerOptions GetJsonSerializerOptions(SerializationFormatting formatting = SerializationFormatting.None) + override void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + override void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + override Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + override Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + protected internal virtual bool SupportsFastPath(Type type) + + static class TestableResponseFactory + static T CreateResponse(T response, int httpStatusCode, bool statusCodeRepresentsSuccess) where T : TransportResponse + static T CreateSuccessfulResponse(T response, int httpStatusCode) where T : TransportResponse + + record TransportConfiguration : ITransportConfiguration, IRequestConfiguration, IDisposable, IEquatable + TransportConfiguration(ITransportConfiguration config) + TransportConfiguration(NodePool nodePool, IRequestInvoker? requestInvoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + protected TransportConfiguration(TransportConfiguration original) + TransportConfiguration(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri? uri = null, ProductRegistration? productRegistration = null) + static readonly int DefaultConnectionLimit + static readonly TimeSpan DefaultDnsRefreshTimeout + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + int ConnectionLimit { get; init; } + string? ContentType { get; init; } + DateTimeProvider DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; init; } + virtual bool DebugMode { get; init; } + static MemoryStreamFactory DefaultMemoryStreamFactory { get; } + bool? DisableAuditTrail { get; init; } + bool DisableAutomaticProxyDetection { get; init; } + bool? DisableDirectStreaming { get; init; } + bool DisableMetaHeader { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + TimeSpan DnsRefreshTimeout { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + TimeSpan? KeepAliveInterval { get; init; } + TimeSpan? KeepAliveTime { get; init; } + TimeSpan? MaxDeadTimeout { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + MemoryStreamFactory MemoryStreamFactory { get; init; } + MetaHeaderProvider? MetaHeaderProvider { get; init; } + NodePool NodePool { get; } + Func? NodePredicate { get; init; } + Action? OnConfigurationBound { get; init; } + Action? OnRequestCompleted { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestPipelineFactory PipelineProvider { get; init; } + bool PrettyJson { get; init; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; init; } + string? ProxyPassword { get; init; } + string? ProxyUsername { get; init; } + NameValueCollection? QueryStringParameters { get; init; } + IRequestInvoker RequestInvoker { get; } + RequestMetaData? RequestMetaData { get; init; } + Serializer RequestResponseSerializer { get; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + Func? ServerCertificateValidationCallback { get; init; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; init; } + TimeSpan? SniffInformationLifeSpan { get; init; } + bool SniffsOnConnectionFault { get; init; } + bool SniffsOnStartup { get; init; } + Func StatusCodeToResponseSuccess { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UrlFormatter UrlFormatter { get; init; } + UserAgent UserAgent { get; init; } + virtual TransportConfiguration $() + void Dispose() + virtual bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(TransportConfiguration? left, TransportConfiguration? right) + static bool operator !=(TransportConfiguration? left, TransportConfiguration? right) + + class TransportConfigurationDescriptor : TransportConfigurationDescriptorBase + TransportConfigurationDescriptor(ITransportConfiguration config) + TransportConfigurationDescriptor(NodePool nodePool, IRequestInvoker? invoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(Uri? uri = null, ProductRegistration? productRegistration = null) + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + abstract class TransportConfigurationDescriptorBase : ITransportConfiguration, IRequestConfiguration, IDisposable where T : TransportConfigurationDescriptorBase + protected TransportConfigurationDescriptorBase(ITransportConfiguration config) + protected TransportConfigurationDescriptorBase(NodePool nodePool, IRequestInvoker? requestInvoker, Serializer? requestResponseSerializer, ProductRegistration? productRegistration) + protected Serializer UseThisRequestResponseSerializer { get; set; } + protected T Assign(TValue value, Action assigner) + T Authentication(AuthorizationHeader header) + T CertificateFingerprint(string fingerprint) + T ClientCertificate(X509Certificate certificate) + T ClientCertificate(string certificatePath) + T ClientCertificates(X509CertificateCollection certificates) + T ConnectionLimit(int connectionLimit) + T DeadTimeout(TimeSpan timeout) + T DisableAuditTrail(bool b = true) + T DisableAutomaticProxyDetection(bool disable = true) + T DisableDirectStreaming(bool b = true) + T DisableMetaHeader(bool disable = true) + T DisablePing(bool disable = true) + protected virtual void DisposeManagedResources() + T DnsRefreshTimeout(TimeSpan timeout) + virtual T EnableDebugMode(Action? onRequestCompleted = null) + T EnableHttpCompression(bool enabled = true) + T EnableHttpPipelining(bool enabled = true) + T EnableTcpKeepAlive(TimeSpan keepAliveTime, TimeSpan keepAliveInterval) + T EnableTcpStats(bool enableTcpStats = true) + T EnableThreadPoolStats(bool enableThreadPoolStats = true) + T GlobalHeaders(NameValueCollection headers) + T GlobalQueryStringParameters(NameValueCollection queryStringParameters) + T MaxDeadTimeout(TimeSpan timeout) + T MaxRetryTimeout(TimeSpan maxRetryTimeout) + T MaximumRetries(int maxRetries) + T MemoryStreamFactory(MemoryStreamFactory memoryStreamFactory) + T NodePredicate(Func predicate) + T OnBoundConfigurationCreated(Action handler) + T OnRequestCompleted(Action handler) + virtual T ParseAllHeaders(bool b = true) + T PingTimeout(TimeSpan timeout) + T PipelineProvider(RequestPipelineFactory provider) + virtual T PrettyJson(bool b = true) + T Proxy(Uri proxyAddress, string username, string password) + T Proxy(Uri proxyAddress) + T RequestTimeout(TimeSpan timeout) + T ResponseBuilder(IResponseBuilder responseBuilder) + virtual T ResponseHeadersToParse(HeadersList headersToParse) + T ServerCertificateValidationCallback(Func callback) + T SkipDeserializationForStatusCodes(params int[] statusCodes) + T SniffLifeSpan(TimeSpan? sniffLifeSpan) + T SniffOnConnectionFault(bool sniffsOnConnectionFault = true) + T SniffOnStartup(bool sniffsOnStartup = true) + T ThrowExceptions(bool alwaysThrow = true) + T TransferEncodingChunked(bool transferEncodingChunked = true) + protected T UpdateGlobalQueryString(string key, string value, bool enabled) + T UserAgent(UserAgent userAgent) + + class TransportException : Exception + TransportException(PipelineFailure failure, string message, TransportResponse response) + TransportException(PipelineFailure failure, string message, Exception? innerException = null) + TransportException(string message) + ApiCallDetails? ApiCallDetails { get; } + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + Endpoint? Endpoint { get; } + PipelineFailure? FailureReason { get; } + + static class TransportExtensions + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData, IRequestConfiguration configuration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + static class TransportHttpMethodExtensions + static TResponse Delete(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default) where TResponse : TransportResponse, new() + static TResponse Delete(this ITransport transport, string path, RequestParameters parameters, PostData? data = null) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string path, RequestParameters parameters, PostData? data = null, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string pathAndQuery) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string path, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static VoidResponse Head(this ITransport transport, string pathAndQuery, TimeSpan timeout) + static VoidResponse Head(this ITransport transport, string pathAndQuery) + static VoidResponse Head(this ITransport transport, string path, RequestParameters parameters) + static Task HeadAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string pathAndQuery, TimeSpan timeout, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + abstract class TransportResponse + protected TransportResponse() + [JsonIgnore] + ApiCallDetails ApiCallDetails { get; } + [JsonIgnore] + protected internal virtual bool LeaveOpen { get; } + [JsonIgnore] + protected internal IEnumerable? LinkedDisposables { get; } + override string ToString() + + abstract class TransportResponse : TransportResponse + protected TransportResponse() + T Body { get; protected internal set; } + + class TransportSerializerOptionsProvider : IJsonSerializerOptionsProvider + TransportSerializerOptionsProvider() + TransportSerializerOptionsProvider(IReadOnlyCollection bakedInConverters, IReadOnlyCollection? userProvidedConverters, Action? mutateOptions = null) + JsonSerializerOptions CreateJsonSerializerOptions() + + abstract class TypedResponseBuilder : IResponseBuilder + protected TypedResponseBuilder() + protected abstract TResponse Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) + protected abstract Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) + + class UnexpectedTransportException : TransportException + UnexpectedTransportException(Exception killerException, IReadOnlyCollection? seenExceptions) + IReadOnlyCollection SeenExceptions { get; } + + sealed class UrlFormatter : IFormatProvider, ICustomFormatter + UrlFormatter(ITransportConfiguration settings) + static string CreateString(object? value, ITransportConfiguration settings) + string CreateString(object? value) + string Format(string? format, object? arg, IFormatProvider? formatProvider) + object? GetFormat(Type? formatType) + + sealed class UserAgent + static UserAgent Create(string reposName, Type typeVersionLookup, string[] metadata) + static UserAgent Create(string reposName, Type typeVersionLookup) + static UserAgent Create(string fullUserAgentString) + override string ToString() + + abstract class VersionInfo + protected VersionInfo(SemVersion version) + bool IsPrerelease { get; } + int Major { get; } + string? Metadata { get; } + int Minor { get; } + int Patch { get; } + string? Prerelease { get; } + string ToMetadataHeaderValue() + override string ToString() + + sealed class VoidResponse : TransportResponse + VoidResponse() + static VoidResponse Default { get; } + class VoidBody + VoidBody() + +namespace Elastic.Transport.Diagnostics + static class OpenTelemetry + const string ElasticTransportActivitySourceName = "Elastic.Transport" + static bool ElasticTransportActivitySourceHasListeners { get; } + + class ThreadPoolStatistics + ThreadPoolStatistics(int min, int max, int busy, int free) + int Busy { get; } + int Free { get; } + int Max { get; } + int Min { get; } + + static class ThreadPoolStats + static ReadOnlyDictionary GetStats() + + abstract class TypedDiagnosticObserver : IObserver> + protected TypedDiagnosticObserver(Action> onNextStart, Action> onNextEnd, Action? onError = null, Action? onCompleted = null) + +namespace Elastic.Transport.Diagnostics.Auditing + sealed class Audit + DateTimeOffset Ended { get; } + AuditEvent Event { get; } + Exception? Exception { get; } + Node? Node { get; } + DateTimeOffset Started { get; } + override string ToString() + + enum AuditEvent + SniffOnStartup = 0 + SniffOnFail = 1 + SniffOnStaleCluster = 2 + SniffSuccess = 3 + SniffFailure = 4 + PingSuccess = 5 + PingFailure = 6 + Resurrection = 7 + AllNodesDead = 8 + BadResponse = 9 + HealthyResponse = 10 + MaxTimeoutReached = 11 + MaxRetriesReached = 12 + BadRequest = 13 + NoNodesAttempted = 14 + CancellationRequested = 15 + FailedOverAllNodes = 16 + + class Auditor : IReadOnlyCollection, IEnumerable, IEnumerable + int Count { get; } + void Emit(AuditEvent type, Node node) + void Emit(AuditEvent type) + IEnumerator GetEnumerator() + +namespace Elastic.Transport.Extensions + sealed class SemVersion : IEquatable, IComparable, IComparable + SemVersion(int major, int minor, int patch, string? prerelease, string? metadata) + SemVersion(int major, int minor, int patch, string? prerelease) + SemVersion(int major, int minor, int patch) + int Major { get; } + string Metadata { get; } + int Minor { get; } + int Patch { get; } + string Prerelease { get; } + int CompareByPrecedence(SemVersion? other) + int CompareTo(SemVersion? other) + int CompareTo(object? obj) + bool Equals(SemVersion? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool TryParse(string input, [NotNullWhen(true)] out SemVersion? version) + SemVersion Update(int? major = default, int? minor = default, int? patch = default, string? prerelease = null, string? metadata = null) + static bool operator ==(SemVersion left, SemVersion right) + static bool operator >(SemVersion left, SemVersion right) + static bool operator >=(SemVersion left, SemVersion right) + static bool operator !=(SemVersion left, SemVersion right) + static bool operator <(SemVersion left, SemVersion right) + static bool operator <=(SemVersion left, SemVersion right) + + static class TransportSerializerExtensions + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, string input, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, string input, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, JsonElement node, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, JsonElement node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, JsonNode node, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, JsonNode node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static T? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, MemoryStreamFactory? memoryStreamFactory = null) + static object? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, Type type, MemoryStreamFactory? memoryStreamFactory = null) + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + static bool TryGetJsonSerializerOptions(this Serializer serializer, [NotNullWhen(true)] out JsonSerializerOptions? options, SerializationFormatting formatting = SerializationFormatting.None) + +namespace Elastic.Transport.Products + sealed class DefaultProductRegistration : ProductRegistration + DefaultProductRegistration() + static DefaultProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override HeadersList ResponseHeadersToParse { get; } + override string? ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ProductRegistration + protected ProductRegistration() + abstract string? DefaultContentType { get; } + abstract IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + abstract MetaHeaderProvider MetaHeaderProvider { get; } + abstract string Name { get; } + abstract string ProductAssemblyVersion { get; } + virtual IReadOnlyCollection ResponseBuilders { get; } + abstract HeadersList ResponseHeadersToParse { get; } + abstract string? ServiceIdentifier { get; } + abstract bool SupportsPing { get; } + abstract bool SupportsSniff { get; } + abstract Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + abstract Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + abstract IReadOnlyCollection DefaultHeadersToParse() + abstract bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + virtual bool IsErrorContentType(string? contentType) + virtual bool IsExpectedResponseContentType(string accept, string? responseContentType) + virtual bool IsJsonContentType(string? contentType) + virtual bool IsValidResponse(ApiCallDetails? details) + abstract bool NodePredicate(Node node) + abstract Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + abstract TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract int SniffOrder(Node node) + virtual string? TransformContentType(string? contentType) + virtual ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + abstract bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + +namespace Elastic.Transport.Products.Elasticsearch + record ElasticsearchConfiguration : TransportConfiguration, IEquatable + protected ElasticsearchConfiguration(ElasticsearchConfiguration original) + ElasticsearchConfiguration(string cloudId, ApiKey credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, ApiKey credentials) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, ApiKey credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri? uri = null) + protected override Type EqualityContract { get; } + override TransportConfiguration $() + virtual bool Equals(ElasticsearchConfiguration? other) + sealed override bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected override bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + static bool operator !=(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + + sealed class ElasticsearchDynamicResponse : DynamicResponseBase, IElasticsearchResponse + ElasticsearchDynamicResponse() + ElasticsearchDynamicResponse(DynamicDictionary dictionary) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchErrorExtensions + static bool TryGetElasticsearchServerError(this BytesResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this StringResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this TransportResponse response, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchJsonResponse : JsonResponseBase, IElasticsearchResponse + ElasticsearchJsonResponse() + ElasticsearchJsonResponse(JsonNode node) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchNodeFeatures + static readonly IReadOnlyCollection Default + const string HoldsData = "node.data" + const string HttpEnabled = "node.http" + const string IngestEnabled = "node.ingest" + const string MasterEligible = "node.master" + static readonly IReadOnlyCollection MasterEligibleOnly + static readonly IReadOnlyCollection NotMasterEligible + + class ElasticsearchProductRegistration : ProductRegistration + ElasticsearchProductRegistration(Type markerType) + const string SniffPath = "_nodes/http,settings" + static ProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override IReadOnlyCollection ResponseBuilders { get; } + override HeadersList ResponseHeadersToParse { get; } + sealed override string ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool IsErrorContentType(string? contentType) + override bool IsExpectedResponseContentType(string accept, string? responseContentType) + override bool IsJsonContentType(string? contentType) + override bool IsValidResponse(ApiCallDetails? details) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override string? TransformContentType(string? contentType) + override ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ElasticsearchResponse : TransportResponse, IElasticsearchResponse + protected ElasticsearchResponse() + [JsonIgnore] + string DebugInformation { get; } + [JsonIgnore] + ElasticsearchServerError? ElasticsearchServerError { get; } + [JsonIgnore] + IEnumerable ElasticsearchWarnings { get; } + [JsonIgnore] + virtual bool IsValidResponse { get; } + protected virtual void DebugIsValid(StringBuilder sb) + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ElasticsearchServerError : ErrorResponse + ElasticsearchServerError() + ElasticsearchServerError(Error error, int? statusCode) + [DataMember(Name = "error")] + [JsonPropertyName("error")] + Error? Error { get; init; } + [DataMember(Name = "status")] + [JsonPropertyName("status")] + int Status { get; init; } + static ElasticsearchServerError Create(Stream stream) + static ValueTask CreateAsync(Stream stream, CancellationToken token = default) + override bool HasError() + override string ToString() + static bool TryCreate(Stream stream, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchStreamResponse : StreamResponseBase, IElasticsearchResponse + ElasticsearchStreamResponse() + ElasticsearchStreamResponse(Stream body, string? contentType) + Stream Body { get; } + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + sealed class ElasticsearchStringResponse : StringResponseBase, IElasticsearchResponse + ElasticsearchStringResponse() + ElasticsearchStringResponse(string body) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.13.2411")] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ErrorCause))] + [JsonSerializable(typeof(System.Collections.Generic.Dictionary`2[[System.String, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51],[System.Object, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]], netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyCollection`1[Elastic.Transport.Products.Elasticsearch.ErrorCause], netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyDictionary`2[[System.String, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51],[System.String, netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]], netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51))] + [JsonSerializable(typeof(System.Object[], netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51))] + [JsonSerializable(typeof(System.String))] + [JsonSerializable(typeof(System.Text.Json.JsonElement))] + [JsonSourceGenerationOptions(GenerationMode = (JsonSourceGenerationMode)0, UseStringEnumConverter = true)] + class ElasticsearchTransportSerializerContext : JsonSerializerContext, IJsonTypeInfoResolver + ElasticsearchTransportSerializerContext() + ElasticsearchTransportSerializerContext(JsonSerializerOptions options) + static ElasticsearchTransportSerializerContext Default { get; } + JsonTypeInfo> DictionaryStringObject { get; } + JsonTypeInfo ElasticsearchResponse { get; } + JsonTypeInfo ElasticsearchServerError { get; } + JsonTypeInfo Error { get; } + JsonTypeInfo ErrorCause { get; } + protected override JsonSerializerOptions? GeneratedSerializerOptions { get; } + JsonTypeInfo> IReadOnlyCollectionErrorCause { get; } + JsonTypeInfo> IReadOnlyDictionaryStringString { get; } + JsonTypeInfo Int32 { get; } + JsonTypeInfo JsonElement { get; } + JsonTypeInfo Object { get; } + JsonTypeInfo ObjectArray { get; } + JsonTypeInfo String { get; } + override JsonTypeInfo? GetTypeInfo(Type type) + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.Products.Elasticsearch.ErrorConverter))] + sealed class Error : ErrorCause + Error() + [JsonPropertyName("headers")] + IReadOnlyDictionary Headers { get; set; } + [JsonPropertyName("root_cause")] + IReadOnlyCollection? RootCause { get; set; } + override string ToString() + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.ErrorCauseConverter))] + class ErrorCause + ErrorCause() + IReadOnlyDictionary AdditionalProperties { get; } + ErrorCause? CausedBy { get; } + string? Index { get; } + string? IndexUUID { get; } + string? Reason { get; } + [JsonPropertyName("stack_trace")] + string? StackTrace { get; } + string? Type { get; } + override string ToString() + + sealed class ErrorConverter : JsonConverter + ErrorConverter() + override Error? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + override void Write(Utf8JsonWriter writer, Error value, JsonSerializerOptions options) + + interface IElasticsearchResponse + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ShardFailure + ShardFailure() + [JsonPropertyName("index")] + string? Index { get; set; } + [JsonPropertyName("node")] + string? Node { get; set; } + [JsonPropertyName("reason")] + ErrorCause? Reason { get; set; } + [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] + [JsonPropertyName("shard")] + int? Shard { get; set; } + [JsonPropertyName("status")] + string? Status { get; set; } + + static class SniffParser + static Regex AddressRegex { get; } + static Uri ParseToUri(string boundAddress, bool forceHttp) From 4617dea23456f7902a56d7538556ec92915c2da0 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 24 Nov 2026 15:49:54 +0100 Subject: [PATCH 03/12] Check the public API on every pull request assembly-differ reports what a pull request changes against the latest release, labels it for release-drafter and fails on a breaking change until the breaking-allowed label is added. verify-api fails when the committed api/ files differ from the build. The ci.yml step that only wrote a file nobody read is gone. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/api-changes.yml | 52 +++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 3 -- 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/api-changes.yml diff --git a/.github/workflows/api-changes.yml b/.github/workflows/api-changes.yml new file mode 100644 index 00000000..6e900e0c --- /dev/null +++ b/.github/workflows/api-changes.yml @@ -0,0 +1,52 @@ +name: Public API + +on: + pull_request: + # labeled and unlabeled run the checks again when someone adds or removes breaking-allowed + types: [opened, synchronize, reopened, labeled, unlabeled] + paths-ignore: + - 'README.md' + - '.editorconfig' + +permissions: + contents: read + pull-requests: write # the comments and the labels + +jobs: + # What the pull request changes in the public API of the libraries, against their latest release on nuget.org. + # A breaking change fails the check until someone adds the breaking-allowed label. + api-changes: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-dotnet@v4 + with: + global-json-file: ./global.json + + - run: dotnet build -c Release + + - uses: nullean/assembly-differ@v1 + with: + version: 1.2.1 + + # The committed api/*.api files must match the build: an intended change to the public API is committed with it. + verify-api: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-dotnet@v4 + with: + global-json-file: ./global.json + + - run: dotnet build -c Release + + - uses: nullean/assembly-differ/verify-api@v1 + with: + version: 1.2.1 + directory: api + projects: | + src/Elastic.Transport/Elastic.Transport.csproj + src/Elastic.Transport.VirtualizedCluster/Elastic.Transport.VirtualizedCluster.csproj + comment: 'true' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6912fe3f..ec2a8b13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,9 +79,6 @@ jobs: - run: ./build.sh validatepackages -s true name: "validate *.npkg files that were created" - - run: ./build.sh generateapichanges -s true - name: "Inspect public API changes" - - name: publish canary packages github package repository if: github.event_name == 'push' && startswith(github.ref, 'refs/heads') shell: bash From 14ab397dd08b21cecdc4ab5cdfe1343764553c0e Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 24 Nov 2026 15:50:44 +0100 Subject: [PATCH 04/12] Verify the public API in a test Co-Authored-By: Claude Sonnet 5.5 --- Elastic.Transport.slnx | 1 + ...TransportPublicApiIsUnchanged.verified.api | 1605 +++++++++++++++++ ...edClusterPublicApiIsUnchanged.verified.api | 211 +++ .../Elastic.Transport.PublicApi.Tests.csproj | 30 + .../PublicApiTests.cs | 26 + 5 files changed, 1873 insertions(+) create mode 100644 tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/TransportPublicApiIsUnchanged.verified.api create mode 100644 tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/VirtualizedClusterPublicApiIsUnchanged.verified.api create mode 100644 tests/Elastic.Transport.PublicApi.Tests/Elastic.Transport.PublicApi.Tests.csproj create mode 100644 tests/Elastic.Transport.PublicApi.Tests/PublicApiTests.cs diff --git a/Elastic.Transport.slnx b/Elastic.Transport.slnx index 475a2df1..3673b091 100644 --- a/Elastic.Transport.slnx +++ b/Elastic.Transport.slnx @@ -31,6 +31,7 @@ + diff --git a/tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/TransportPublicApiIsUnchanged.verified.api b/tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/TransportPublicApiIsUnchanged.verified.api new file mode 100644 index 00000000..8ca31d4b --- /dev/null +++ b/tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/TransportPublicApiIsUnchanged.verified.api @@ -0,0 +1,1605 @@ +assembly Elastic.Transport +using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri +using struct System: DateTime, DateTimeOffset, Guid, ReadOnlyMemory<>, ReadOnlySpan<>, TimeSpan, TypeCode +using interface System: IAsyncDisposable, IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> +using System.CodeDom.Compiler: GeneratedCodeAttribute +using interface System.Collections: IEnumerable +using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> +using struct System.Collections.Generic: KeyValuePair<,> +using interface System.Collections.Generic: ICollection<>, IDictionary<,>, IEnumerable<>, IReadOnlyCollection<> +using System.Collections.ObjectModel: ReadOnlyDictionary<,> +using System.Collections.Specialized: NameValueCollection +using System.ComponentModel: BrowsableAttribute, EditorBrowsableAttribute +using System.Diagnostics: Activity +using System.Diagnostics.CodeAnalysis: NotNullWhenAttribute, UnconditionalSuppressMessageAttribute +using System.Dynamic: BinaryOperationBinder, ConvertBinder, DynamicObject, GetMemberBinder, SetMemberBinder +using System.IO: MemoryStream, Stream +using System.IO.Pipelines: PipeReader, PipeWriter +using System.Linq: IOrderedEnumerable<> +using System.Net: HttpWebRequest, ServicePoint +using System.Net.Http: HttpMessageHandler +using struct System.Net.NetworkInformation: TcpState +using struct System.Net.Security: SslPolicyErrors +using System.Runtime.Serialization: DataContractAttribute, DataMemberAttribute, EnumMemberAttribute +using System.Security.Cryptography.X509Certificates: X509Certificate, X509CertificateCollection, X509Chain +using struct System.Security.Cryptography.X509Certificates: X509RevocationMode +using System.Text: StringBuilder +using System.Text.Json: JsonSerializerOptions, Utf8JsonWriter +using struct System.Text.Json: JsonElement, Utf8JsonReader +using System.Text.Json.Nodes: JsonNode +using System.Text.Json.Serialization: JsonConverter, JsonConverter<>, JsonConverterAttribute, JsonIgnoreAttribute, JsonNumberHandlingAttribute, JsonPropertyNameAttribute, JsonSerializableAttribute, JsonSerializerContext, JsonSourceGenerationOptionsAttribute +using System.Text.Json.Serialization.Metadata: JsonTypeInfo, JsonTypeInfo<> +using interface System.Text.Json.Serialization.Metadata: IJsonTypeInfoResolver +using System.Text.RegularExpressions: Regex +using System.Threading: SemaphoreSlim +using struct System.Threading: CancellationToken +using System.Threading.Tasks: Task, Task<> +using struct System.Threading.Tasks: ValueTask, ValueTask<> + +namespace Elastic.Transport + sealed class ApiCallDetails + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + bool HasExpectedContentType { get; } + bool HasSuccessfulStatusCode { get; } + HttpMethod HttpMethod { get; } + int? HttpStatusCode { get; } + Exception? OriginalException { get; } + ErrorResponse? ProductError { get; } + byte[]? RequestBodyInBytes { get; } + byte[]? ResponseBodyInBytes { get; } + string ResponseContentType { get; set; } + [Obsolete("This property has been retired and replaced by ResponseContentType. Prefer using the updated property as this will be removed in a future release.")] + string ResponseMimeType { get; set; } + Uri? Uri { get; } + override string ToString() + bool TryGetHeader(string key, [NotNullWhen(true)] out IEnumerable? headerValues) + + class ApiKey : AuthorizationHeader + ApiKey(string apiKey) + override string AuthScheme { get; } + override bool TryGetAuthorizationParameters(out string value) + + abstract class AuthorizationHeader + protected AuthorizationHeader() + abstract string AuthScheme { get; } + abstract bool TryGetAuthorizationParameters(out string value) + + class Base64ApiKey : ApiKey + Base64ApiKey(string id, string apiKey) + Base64ApiKey(string base64EncodedApiKey) + + sealed class BasicAuthentication : AuthorizationHeader + BasicAuthentication(string username, string password) + override string AuthScheme { get; } + static string BasicAuthenticationScheme { get; } + static string GetBase64String(string header) + override bool TryGetAuthorizationParameters(out string value) + + sealed record BoundConfiguration : IRequestConfiguration, IEquatable + BoundConfiguration(ITransportConfiguration global, IRequestConfiguration? local = null) + const string DefaultContentType = "application/json" + const string RunAsSecurityHeader = "es-security-runas-user" + string Accept { get; } + IReadOnlyCollection AllowedStatusCodes { get; } + AuthorizationHeader? AuthenticationHeader { get; } + X509CertificateCollection? ClientCertificates { get; } + ITransportConfiguration ConnectionSettings { get; } + string ContentType { get; } + bool DisableAuditTrail { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableDirectStreaming { get; } + bool DisablePings { get; } + bool DisableSniff { get; } + TimeSpan DnsRefreshTimeout { get; } + bool EnableTcpStats { get; } + bool EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool HttpCompression { get; } + bool HttpPipeliningEnabled { get; } + int KeepAliveInterval { get; } + int KeepAliveTime { get; } + int MaxRetries { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + string? OpaqueId { get; } + bool ParseAllHeaders { get; } + TimeSpan PingTimeout { get; } + IReadOnlyCollection ProductResponseBuilders { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + IReadOnlyCollection SkipDeserializationForStatusCodes { get; } + bool ThrowExceptions { get; } + bool TransferEncodingChunked { get; } + UserAgent UserAgent { get; } + BoundConfiguration $() + static BoundConfiguration Create(ITransport transport, IRequestConfiguration requestConfiguration) + bool Equals(BoundConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool operator ==(BoundConfiguration? left, BoundConfiguration? right) + static bool operator !=(BoundConfiguration? left, BoundConfiguration? right) + + sealed class BytesResponse : TransportResponse + BytesResponse() + BytesResponse(byte[] body) + + static class CertificateValidations + static bool AllowAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + static Func AuthorityIsRoot(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static Func AuthorityPartOfChain(X509Certificate caCertificate, bool trustRoot = true, X509RevocationMode revocationMode = X509RevocationMode.NoCheck) + static bool DenyAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) + + sealed class CloudNodePool : SingleNodePool + CloudNodePool(string cloudId, AuthorizationHeader credentials, CloudService service) + CloudNodePool(string cloudId, AuthorizationHeader credentials) + CloudNodePool(Uri cloudEndpoint, AuthorizationHeader credentials) + AuthorizationHeader AuthenticationHeader { get; } + + enum CloudService + Elasticsearch = 0 + Kibana = 1 + + abstract class DateTimeProvider + abstract DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + abstract DateTimeOffset Now() + + sealed class DefaultDateTimeProvider : DateTimeProvider + DefaultDateTimeProvider() + static readonly DefaultDateTimeProvider Default + override DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + override DateTimeOffset Now() + + sealed class DefaultMemoryStreamFactory : MemoryStreamFactory + DefaultMemoryStreamFactory() + static DefaultMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class DefaultMetaHeaderProducer : MetaHeaderProducer + DefaultMetaHeaderProducer(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProducer(Type clientType, string serviceIdentifier) + override string HeaderName { get; } + override string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + sealed class DefaultMetaHeaderProvider : MetaHeaderProvider + DefaultMetaHeaderProvider(VersionInfo versionInfo, string serviceIdentifier) + DefaultMetaHeaderProvider(Type clientType, string serviceIdentifier) + override MetaHeaderProducer[] Producers { get; } + + sealed class DefaultRequestParameters : RequestParameters + DefaultRequestParameters() + + sealed class DistributedTransport : DistributedTransport + DistributedTransport(ITransportConfiguration configuration) + + class DistributedTransport : ITransport, ITransport where TConfiguration : class, ITransportConfiguration + DistributedTransport(TConfiguration configuration) + TConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + sealed class DynamicDictionary : DynamicObject, IEquatable, IDictionary, ICollection>, IEnumerable>, IEnumerable + DynamicDictionary() + int Count { get; } + static DynamicDictionary Empty { get; } + bool IsReadOnly { get; } + DynamicValue this[string name] { get; set; } + ICollection Keys { get; } + ICollection Values { get; } + void Add(KeyValuePair item) + void Add(string key, DynamicValue value) + void Clear() + bool Contains(KeyValuePair item) + bool ContainsKey(string key) + void CopyTo(KeyValuePair[] array, int arrayIndex) + static DynamicDictionary Create(IDictionary values) + static DynamicDictionary Create(JsonElement e) + bool Equals(DynamicDictionary? other) + override bool Equals(object? obj) + T Get(string? path) + override IEnumerable GetDynamicMemberNames() + override int GetHashCode() + bool Remove(KeyValuePair item) + bool Remove(string key) + Dictionary ToDictionary() + override bool TryGetMember(GetMemberBinder binder, out object result) + bool TryGetValue(string key, out DynamicValue value) + override bool TrySetMember(SetMemberBinder binder, object? value) + + sealed class DynamicResponse : DynamicResponseBase + DynamicResponse() + DynamicResponse(DynamicDictionary dictionary) + + abstract class DynamicResponseBase : TransportResponse + protected DynamicResponseBase() + protected DynamicResponseBase(DynamicDictionary dictionary) + T Get(string path) + + sealed class DynamicValue : DynamicObject, IEquatable, IConvertible, IReadOnlyCollection, IEnumerable, IEnumerable + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + DynamicValue(object? value) + int Count { get; } + bool HasValue { get; } + DynamicValue this[int i] { get; } + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "Manually verified")] + DynamicValue this[string name] { get; } + static DynamicValue NullValue { get; } + object? Value { get; } + static object? ConsumeJsonElement(Type targetReturnType, JsonElement e) + T? Default(T? defaultValue = null) + bool Equals(DynamicValue? compareValue) + override bool Equals(object? obj) + T? Get(string path) + IEnumerator GetEnumerator() + override int GetHashCode() + TypeCode GetTypeCode() + static DynamicValue SelfOrNew(object v) + bool ToBoolean(IFormatProvider? provider) + byte ToByte(IFormatProvider? provider) + char ToChar(IFormatProvider? provider) + DateTime ToDateTime(IFormatProvider? provider) + decimal ToDecimal(IFormatProvider? provider) + IDictionary? ToDictionary() + double ToDouble(IFormatProvider? provider) + IEnumerable ToEnumerable() + short ToInt16(IFormatProvider? provider) + int ToInt32(IFormatProvider? provider) + long ToInt64(IFormatProvider? provider) + [CLSCompliant(false)] + sbyte ToSByte(IFormatProvider? provider) + float ToSingle(IFormatProvider? provider) + override string? ToString() + string ToString(IFormatProvider? provider) + object ToType(Type conversionType, IFormatProvider? provider) + [CLSCompliant(false)] + ushort ToUInt16(IFormatProvider? provider) + [CLSCompliant(false)] + uint ToUInt32(IFormatProvider? provider) + [CLSCompliant(false)] + ulong ToUInt64(IFormatProvider? provider) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "Manually verified")] + override bool TryBinaryOperation(BinaryOperationBinder binder, object arg, out object? result) + override bool TryConvert(ConvertBinder binder, out object? result) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "Manually verified")] + [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "Manually verified")] + override bool TryGetMember(GetMemberBinder binder, out object? result) + T? TryParse(T? defaultValue = null) + static bool operator ==(DynamicValue dynamicValue, object compareValue) + static bool operator !=(DynamicValue dynamicValue, object compareValue) + static implicit operator bool(DynamicValue dynamicValue) + static implicit operator string?(DynamicValue dynamicValue) + static implicit operator int(DynamicValue dynamicValue) + static implicit operator Guid(DynamicValue dynamicValue) + static implicit operator DateTime(DynamicValue dynamicValue) + static implicit operator DateTimeOffset(DynamicValue dynamicValue) + static implicit operator TimeSpan(DynamicValue dynamicValue) + static implicit operator long(DynamicValue dynamicValue) + static implicit operator float(DynamicValue dynamicValue) + static implicit operator decimal(DynamicValue dynamicValue) + static implicit operator double(DynamicValue dynamicValue) + + record Endpoint : IEquatable + Endpoint(in EndpointPath Path, Node Node) + protected Endpoint(Endpoint original) + protected virtual Type EqualityContract { get; } + bool IsEmpty { get; } + HttpMethod Method { get; } + Node Node { get; init; } + EndpointPath Path { get; init; } + string PathAndQuery { get; } + Uri Uri { get; } + virtual Endpoint $() + void Deconstruct(out EndpointPath Path, out Node Node) + static Endpoint Empty(in EndpointPath path) + virtual bool Equals(Endpoint? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(Endpoint? left, Endpoint? right) + static bool operator !=(Endpoint? left, Endpoint? right) + + readonly struct EndpointPath : IEquatable + EndpointPath(HttpMethod Method, string PathAndQuery) + HttpMethod Method { get; init; } + string PathAndQuery { get; init; } + void Deconstruct(out HttpMethod Method, out string PathAndQuery) + bool Equals(EndpointPath other) + override bool Equals(object obj) + override int GetHashCode() + override string ToString() + static bool operator ==(EndpointPath left, EndpointPath right) + static bool operator !=(EndpointPath left, EndpointPath right) + + class ErrorCauseConverter : ErrorCauseConverter + ErrorCauseConverter() + + abstract class ErrorCauseConverter : JsonConverter where TErrorCause : ErrorCause, new() + protected ErrorCauseConverter() + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override TErrorCause? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + protected virtual bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, TErrorCause errorCause) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override void Write(Utf8JsonWriter writer, TErrorCause value, JsonSerializerOptions options) + + class ErrorConverter : ErrorCauseConverter + ErrorConverter() + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + protected override bool ReadMore(ref Utf8JsonReader reader, JsonSerializerOptions options, string propertyName, Error errorCause) + + abstract class ErrorResponse + abstract bool HasError() + + readonly struct HeadersList : IEnumerable, IEnumerable + HeadersList(IEnumerable headers, IEnumerable otherHeaders) + HeadersList(IEnumerable headers, string additionalHeader) + HeadersList(IEnumerable headers) + HeadersList(HeadersList? headers, HeadersList? otherHeaders) + HeadersList(string header) + int Count { get; } + IEnumerator GetEnumerator() + + enum HttpMethod + [EnumMember(Value = "GET")] + GET = 0 + [EnumMember(Value = "POST")] + POST = 1 + [EnumMember(Value = "PUT")] + PUT = 2 + [EnumMember(Value = "DELETE")] + DELETE = 3 + [EnumMember(Value = "HEAD")] + HEAD = 4 + + static class HttpMethodExtensions + static string GetStringValue(this HttpMethod httpMethod) + + class HttpRequestInvoker : IRequestInvoker, IDisposable + HttpRequestInvoker() + HttpRequestInvoker(Func wrappingHandler) + int InUseHandlers { get; } + int RemovedHandlers { get; } + ResponseFactory ResponseFactory { get; } + protected HttpMessageHandler CreateHttpClientHandler(BoundConfiguration boundConfiguration) + void Dispose() + virtual void DisposeManagedResources() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + [Obsolete("CoreFX HttpWebRequest uses HttpClient under the covers but does not reuse HttpClient instances, do NOT use on .NET core only used as the default on Full Framework")] + class HttpWebRequestInvoker : IRequestInvoker, IDisposable + HttpWebRequestInvoker() + ResponseFactory ResponseFactory { get; } + protected virtual void AlterServicePoint(ServicePoint requestServicePoint, BoundConfiguration boundConfiguration) + protected virtual HttpWebRequest CreateHttpWebRequest(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, bool isAsync) + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected virtual void SetAuthenticationIfNeeded(Endpoint endpoint, BoundConfiguration boundConfiguration, HttpWebRequest request) + protected virtual void SetClientCertificates(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetProxyIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + protected virtual void SetServerCertificateValidationCallBackIfNeeded(HttpWebRequest request, BoundConfiguration boundConfiguration) + + interface IJsonSerializerOptionsProvider + JsonSerializerOptions CreateJsonSerializerOptions() + + interface IRequestConfiguration + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; } + AuthorizationHeader? Authentication { get; } + X509CertificateCollection? ClientCertificates { get; } + string? ContentType { get; } + bool? DisableAuditTrail { get; } + bool? DisableDirectStreaming { get; } + bool? DisablePings { get; } + bool? DisableSniff { get; } + bool? EnableHttpCompression { get; } + bool? EnableTcpStats { get; } + bool? EnableThreadPoolStats { get; } + Uri? ForceNode { get; } + NameValueCollection? Headers { get; } + bool? HttpPipeliningEnabled { get; } + int? MaxRetries { get; } + TimeSpan? MaxRetryTimeout { get; } + string? OpaqueId { get; } + bool? ParseAllHeaders { get; } + TimeSpan? PingTimeout { get; } + RequestMetaData? RequestMetaData { get; } + TimeSpan? RequestTimeout { get; } + IReadOnlyCollection ResponseBuilders { get; } + HeadersList? ResponseHeadersToParse { get; } + string? RunAs { get; } + bool? ThrowExceptions { get; } + bool? TransferEncodingChunked { get; } + UserAgent? UserAgent { get; } + + interface IRequestInvoker : IDisposable + ResponseFactory ResponseFactory { get; } + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + interface IResponseBuilder + TResponse? Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) where TResponse : TransportResponse, new() + Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + bool CanBuild() where TResponse : TransportResponse, new() + + interface IStringable + string GetString() + + interface ITransport + ITransportConfiguration Configuration { get; } + TResponse Request(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration) where TResponse : TransportResponse, new() + Task RequestAsync(in EndpointPath path, PostData? postData, Action? configureActivity, IRequestConfiguration? localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + interface ITransportConfiguration : IRequestConfiguration, IDisposable + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; } + int ConnectionLimit { get; } + DateTimeProvider? DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; } + bool DisableAutomaticProxyDetection { get; } + bool DisableMetaHeader { get; } + TimeSpan DnsRefreshTimeout { get; } + TimeSpan? KeepAliveInterval { get; } + TimeSpan? KeepAliveTime { get; } + TimeSpan? MaxDeadTimeout { get; } + MemoryStreamFactory MemoryStreamFactory { get; } + MetaHeaderProvider? MetaHeaderProvider { get; } + NodePool NodePool { get; } + Func? NodePredicate { get; } + Action? OnConfigurationBound { get; } + Action? OnRequestCompleted { get; } + RequestPipelineFactory? PipelineProvider { get; } + bool PrettyJson { get; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; } + string? ProxyPassword { get; } + string? ProxyUsername { get; } + NameValueCollection? QueryStringParameters { get; } + IRequestInvoker RequestInvoker { get; } + Serializer RequestResponseSerializer { get; } + Func? ServerCertificateValidationCallback { get; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; } + TimeSpan? SniffInformationLifeSpan { get; } + bool SniffsOnConnectionFault { get; } + bool SniffsOnStartup { get; } + Func StatusCodeToResponseSuccess { get; } + UrlFormatter UrlFormatter { get; } + + interface ITransport : ITransport where TConfiguration : class, ITransportConfiguration + TConfiguration Configuration { get; } + + interface IUrlParameter + string GetString(ITransportConfiguration settings) + + class InMemoryRequestInvoker : IRequestInvoker, IDisposable + InMemoryRequestInvoker() + InMemoryRequestInvoker(byte[]? responseBody, int statusCode = 200, Exception? exception = null, string contentType = "application/json", Dictionary>? headers = null) + ResponseFactory ResponseFactory { get; } + TResponse BuildResponse(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + Task BuildResponseAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken, byte[]? responseBody = null, int? statusCode = default, string? contentType = null) where TResponse : TransportResponse, new() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + + sealed class JsonResponse : JsonResponseBase + JsonResponse() + JsonResponse(JsonNode node) + + abstract class JsonResponseBase : TransportResponse + protected JsonResponseBase() + protected JsonResponseBase(JsonNode node) + T Get(string path) + + abstract class MemoryStreamFactory + protected MemoryStreamFactory() + abstract MemoryStream Create() + abstract MemoryStream Create(byte[] bytes, int index, int count) + abstract MemoryStream Create(byte[] bytes) + + sealed class MetaDataHeader + MetaDataHeader(VersionInfo version, string serviceIdentifier, bool isAsync) + string ClientVersion { get; } + string RuntimeVersion { get; } + string ServiceIdentifier { get; } + string? TransportVersion { get; } + override string ToString() + + abstract class MetaHeaderProducer + protected MetaHeaderProducer() + abstract string HeaderName { get; } + abstract string? ProduceHeaderValue(BoundConfiguration boundConfiguration, bool isAsync) + + abstract class MetaHeaderProvider + protected MetaHeaderProvider() + abstract MetaHeaderProducer[] Producers { get; } + + sealed class Node : IEquatable + Node(Uri uri, IEnumerable? features = null) + DateTimeOffset DeadUntil { get; } + int FailedAttempts { get; } + IReadOnlyCollection Features { get; set; } + string? Id { get; } + bool IsAlive { get; } + bool IsResurrected { get; set; } + string? Name { get; set; } + IReadOnlyDictionary Settings { get; set; } + Uri Uri { get; } + Node Clone() + Uri CreatePath(string path) + bool Equals(Node? other) + override bool Equals(object? obj) + override int GetHashCode() + bool HasFeature(string feature) + void MarkAlive() + void MarkDead(DateTimeOffset until) + static bool operator ==(Node left, Node right) + static bool operator !=(Node left, Node right) + static implicit operator Node(Uri uri) + + abstract class NodePool : IDisposable + protected NodePool() + DateTimeProvider DateTimeProvider { get; set; } + abstract DateTimeOffset? LastUpdate { get; protected set; } + abstract int MaxRetries { get; } + abstract IReadOnlyCollection Nodes { get; } + bool SniffedOnStartup { get; } + abstract bool SupportsPinging { get; } + abstract bool SupportsReseeding { get; } + bool UsingSsl { get; protected set; } + abstract IEnumerable CreateView(Auditor? auditor = null) + void Dispose() + protected virtual void Dispose(bool disposing) + void MarkAsSniffed() + abstract void Reseed(IEnumerable nodes) + + sealed class PipeResponse : PipeResponseBase + PipeResponse() + PipeResponse(Stream responseStream, string? contentType) + PipeReader Body { get; } + + abstract class PipeResponseBase : TransportResponse, IAsyncDisposable, IDisposable + protected PipeResponseBase(Stream responseStream, string? contentType) + string ContentType { get; } + protected internal override bool LeaveOpen { get; } + protected PipeReader Pipe { get; } + Task CopyToAsync(PipeWriter destination, CancellationToken cancellationToken = default) + void Dispose() + ValueTask DisposeAsync() + + class PipelineException : Exception + PipelineException(PipelineFailure failure, Exception? innerException) + PipelineException(PipelineFailure failure) + PipelineFailure FailureReason { get; } + bool Recoverable { get; } + TransportResponse? Response { get; } + + enum PipelineFailure + BadAuthentication = 0 + BadResponse = 1 + PingFailure = 2 + SniffFailure = 3 + CouldNotStartSniffOnStartup = 4 + MaxTimeoutReached = 5 + MaxRetriesReached = 6 + Unexpected = 7 + BadRequest = 8 + NoNodesAttempted = 9 + + abstract class PostData + protected PostData() + protected const int BufferSize = 81920 + protected static readonly byte[] NewLineByteArray + static PostData Empty { get; } + PostType Type { get; } + byte[]? WrittenBytes { get; } + protected void BufferIfNeeded(MemoryStreamFactory memoryStreamFactory, bool disableDirectStreaming, ref MemoryStream? buffer, ref Stream stream) + static PostData Bytes(byte[] bytes) + protected void FinishStream(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming) + protected ValueTask FinishStreamAsync(Stream writableStream, MemoryStream? buffer, bool disableDirectStreaming, CancellationToken ctx) + static PostData MultiJson(IEnumerable listOfSerializables) + static PostData MultiJson(IEnumerable listOfString) + static PostData PipeReader(PipeReader pipeReader) + static PostData PipeWriter(T state, Func asyncWriter) + static PostData ReadOnlyMemory(ReadOnlyMemory bytes) + static PostData Serializable(T data) + static PostData StreamHandler(T state, Action syncWriter, Func asyncWriter) + static PostData String(string serializedString) + abstract void Write(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming) + abstract Task WriteAsync(Stream writableStream, ITransportConfiguration settings, bool disableDirectStreaming, CancellationToken cancellationToken) + static implicit operator PostData(byte[] byteArray) + static implicit operator PostData(string literalString) + + enum PostType + ByteArray = 0 + ReadOnlyMemory = 1 + LiteralString = 2 + Serializable = 3 + EnumerableOfString = 4 + EnumerableOfObject = 5 + StreamHandler = 6 + Pipe = 7 + + sealed class RecyclableMemoryStreamFactory : MemoryStreamFactory + RecyclableMemoryStreamFactory() + static RecyclableMemoryStreamFactory Default { get; } + override MemoryStream Create() + override MemoryStream Create(byte[] bytes, int index, int count) + override MemoryStream Create(byte[] bytes) + + sealed class ReflectionVersionInfo : VersionInfo + static readonly string TransportVersion + static ReflectionVersionInfo Create() + static ReflectionVersionInfo Create(Type type) + + record RequestConfiguration : IRequestConfiguration, IEquatable + RequestConfiguration() + RequestConfiguration(IRequestConfiguration config) + protected RequestConfiguration(RequestConfiguration original) + static readonly TimeSpan DefaultPingTimeout + static readonly TimeSpan DefaultPingTimeoutOnSsl + static readonly TimeSpan DefaultRequestTimeout + static readonly UserAgent DefaultUserAgent + string? Accept { get; init; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + string? ContentType { get; init; } + bool? DisableAuditTrail { get; init; } + bool? DisableDirectStreaming { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestMetaData? RequestMetaData { get; init; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UserAgent? UserAgent { get; init; } + virtual RequestConfiguration $() + virtual bool Equals(RequestConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(RequestConfiguration? left, RequestConfiguration? right) + static bool operator !=(RequestConfiguration? left, RequestConfiguration? right) + + class RequestConfigurationDescriptor : IRequestConfiguration + RequestConfigurationDescriptor() + RequestConfigurationDescriptor(IRequestConfiguration config) + RequestConfigurationDescriptor Accept(string acceptHeader) + RequestConfigurationDescriptor AllowedStatusCodes(IEnumerable? codes) + RequestConfigurationDescriptor AllowedStatusCodes(params int[] codes) + RequestConfigurationDescriptor Authentication(AuthorizationHeader authentication) + RequestConfigurationDescriptor ClientCertificate(X509Certificate certificate) + RequestConfigurationDescriptor ClientCertificate(string certificatePath) + RequestConfigurationDescriptor ClientCertificates(X509CertificateCollection certificates) + RequestConfigurationDescriptor ContentType(string contentTypeHeader) + RequestConfigurationDescriptor DisableAuditTrail(bool disable = true) + RequestConfigurationDescriptor DisableDirectStreaming(bool disable = true) + RequestConfigurationDescriptor DisablePing(bool disable = true) + RequestConfigurationDescriptor DisableSniffing(bool disable = true) + RequestConfigurationDescriptor EnableHttpCompression(bool enable = true) + RequestConfigurationDescriptor EnableHttpPipelining(bool enable = true) + RequestConfigurationDescriptor EnableTcpStats(bool enableTcpStats = true) + RequestConfigurationDescriptor EnableThreadPoolStats(bool enableThreadPoolStats = true) + RequestConfigurationDescriptor ForceNode(Uri uri) + RequestConfigurationDescriptor GlobalHeaders(NameValueCollection headers) + RequestConfigurationDescriptor MaxRetries(int retry) + RequestConfigurationDescriptor MaxRetries(TimeSpan? timeout) + RequestConfigurationDescriptor OpaqueId(string opaqueId) + RequestConfigurationDescriptor ParseAllHeaders(bool enable = true) + RequestConfigurationDescriptor PingTimeout(TimeSpan pingTimeout) + RequestConfigurationDescriptor RequestMetaData(RequestMetaData metaData) + RequestConfigurationDescriptor RequestTimeout(TimeSpan requestTimeout) + RequestConfigurationDescriptor ResponseBuilder(IResponseBuilder responseBuilder) + RequestConfigurationDescriptor ResponseHeadersToParse(IEnumerable headers) + RequestConfigurationDescriptor RunAs(string username) + RequestConfigurationDescriptor ThrowExceptions(bool throwExceptions = true) + RequestConfigurationDescriptor TransferEncodingChunked(bool transferEncodingChunked = true) + RequestConfigurationDescriptor UserAgent(UserAgent userAgent) + + sealed class RequestMetaData + RequestMetaData() + IReadOnlyDictionary? Items { get; } + + static class RequestMetaDataExtensions + static void AddHelper(this RequestMetaData metaData, string helperValue) + + abstract class RequestParameters + protected RequestParameters() + Dictionary QueryString { get; } + string? AcceptHeaderFromFormat(string? format) + bool ContainsQueryString(string name) + virtual string CreatePathWithQueryStrings(string? path, ITransportConfiguration? globalConfig) + TOut? GetQueryStringValue(string name) + protected void Q(string name, IStringable value) + protected void Q(string name, object value) + protected TOut? Q(string name) + void SetQueryString(string name, object? value) + + class RequestPipeline + void AuditCancellationRequested(Auditor? auditor) + void BadResponse(ref TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, TransportException exception, IReadOnlyCollection? auditTrail) where TResponse : TransportResponse, new() + TResponse CallProductEndpoint(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor) where TResponse : TransportResponse, new() + Task CallProductEndpointAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Auditor? auditor, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + TransportException? CreateClientException(TResponse? response, ApiCallDetails? callDetails, Endpoint endpoint, Auditor? auditor, DateTimeOffset startedOn, int attemptedNodes, List? seenExceptions) where TResponse : TransportResponse, new() + void FirstPoolUsage(SemaphoreSlim semaphore, Auditor? auditor) + Task FirstPoolUsageAsync(SemaphoreSlim semaphore, Auditor? auditor, CancellationToken cancellationToken) + void MarkAlive(Node node) + void MarkDead(Node node) + IEnumerable NextNode(DateTimeOffset startedOn, int attemptedNodes, Auditor? auditor) + void Ping(Node node, Auditor? auditor) + Task PingAsync(Node node, Auditor? auditor, CancellationToken cancellationToken = default) + void Sniff(Auditor? auditor) + Task SniffAsync(Auditor? auditor, CancellationToken cancellationToken = default) + void SniffOnConnectionFailure(Auditor? auditor) + Task SniffOnConnectionFailureAsync(Auditor? auditor, CancellationToken cancellationToken) + void SniffOnStaleCluster(Auditor? auditor) + Task SniffOnStaleClusterAsync(Auditor? auditor, CancellationToken cancellationToken) + void ThrowNoNodesAttempted(Endpoint endpoint, Auditor? auditor, List? seenExceptions) + bool TryGetSingleNode(out Node? node) + + abstract class RequestPipelineFactory + abstract RequestPipeline Create(BoundConfiguration boundConfiguration) + + abstract class ResponseFactory + protected ResponseFactory() + abstract TResponse Create(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream? responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats) where TResponse : TransportResponse, new() + abstract Task CreateAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, Exception? ex, int? statusCode, Dictionary>? headers, Stream responseStream, string? contentType, long contentLength, IReadOnlyDictionary? threadPoolStats, IReadOnlyDictionary? tcpStats, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + protected static bool MayHaveBody(int? statusCode, HttpMethod httpMethod, long contentLength) + + enum SerializationFormatting + None = 0 + Indented = 1 + + abstract class Serializer + protected Serializer() + abstract T Deserialize(Stream stream) + abstract object? Deserialize(Type type, Stream stream) + abstract ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + abstract ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + abstract void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + abstract void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + abstract Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + + sealed class SerializerRegistrationInformation + SerializerRegistrationInformation(Type type, string purpose) + string Purpose { get; } + Type TypeInformation { get; } + override string ToString() + + class SingleNodePool : NodePool + SingleNodePool(Uri uri) + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + + class SniffingNodePool : StaticNodePool + SniffingNodePool(IEnumerable nodes, bool randomize = true) + SniffingNodePool(IEnumerable nodes, Func nodeScorer) + SniffingNodePool(IEnumerable uris, bool randomize = true) + override IReadOnlyCollection Nodes { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + protected override void Dispose(bool disposing) + override void Reseed(IEnumerable nodes) + + class StaticNodePool : NodePool + protected StaticNodePool(IEnumerable nodes, bool randomize, int? randomizeSeed = default) + StaticNodePool(IEnumerable nodes, bool randomize = true) + protected StaticNodePool(IEnumerable nodes, Func? nodeScorer = null) + StaticNodePool(IEnumerable uris, bool randomize = true) + protected IReadOnlyList AliveNodes { get; } + protected ref int GlobalCursor { get; } + protected List InternalNodes { get; set; } + override DateTimeOffset? LastUpdate { get; protected set; } + override int MaxRetries { get; } + override IReadOnlyCollection Nodes { get; } + protected Random Random { get; } + protected bool Randomize { get; } + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor = null) + override void Reseed(IEnumerable nodes) + protected Node RetryInternalNodes(int globalCursor, Auditor? auditor = null) + protected static IEnumerable SelectAliveNodes(int cursor, IReadOnlyList aliveNodes, Auditor? auditor = null) + protected IOrderedEnumerable SortNodes(IEnumerable nodes) + + sealed class StickyNodePool : StaticNodePool + StickyNodePool(IEnumerable nodes) + StickyNodePool(IEnumerable uris) + override IEnumerable CreateView(Auditor? auditor) + override void Reseed(IEnumerable nodes) + + sealed class StickySniffingNodePool : SniffingNodePool + StickySniffingNodePool(IEnumerable nodes, Func? nodeScorer = null) + StickySniffingNodePool(IEnumerable uris, Func? nodeScorer = null) + override bool SupportsPinging { get; } + override bool SupportsReseeding { get; } + override IEnumerable CreateView(Auditor? auditor) + + sealed class StreamResponse : StreamResponseBase, IDisposable + StreamResponse() + StreamResponse(Stream body, string? contentType) + Stream Body { get; } + + abstract class StreamResponseBase : TransportResponse, IDisposable + protected StreamResponseBase(Stream responseStream, string? contentType = null) + string ContentType { get; } + protected bool Disposed { get; } + protected internal override bool LeaveOpen { get; } + protected Stream Stream { get; } + void Dispose() + protected virtual void Dispose(bool disposing) + + sealed class StringResponse : StringResponseBase + StringResponse() + StringResponse(string body) + + abstract class StringResponseBase : TransportResponse + protected StringResponseBase() + protected StringResponseBase(string body) + + abstract class SystemTextJsonSerializer : Serializer + protected SystemTextJsonSerializer(IJsonSerializerOptionsProvider? provider = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override T Deserialize(Stream stream) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override object? Deserialize(Type type, Stream stream) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override ValueTask DeserializeAsync(Type type, Stream stream, CancellationToken cancellationToken = default) + protected internal JsonSerializerOptions GetJsonSerializerOptions(SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override void Serialize(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override void Serialize(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override Task SerializeAsync(T data, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + override Task SerializeAsync(object? data, Type type, Stream stream, SerializationFormatting formatting = SerializationFormatting.None, CancellationToken cancellationToken = default) + protected internal virtual bool SupportsFastPath(Type type) + + static class TestableResponseFactory + static T CreateResponse(T response, int httpStatusCode, bool statusCodeRepresentsSuccess) where T : TransportResponse + static T CreateSuccessfulResponse(T response, int httpStatusCode) where T : TransportResponse + + record TransportConfiguration : ITransportConfiguration, IRequestConfiguration, IDisposable, IEquatable + TransportConfiguration(ITransportConfiguration config) + TransportConfiguration(NodePool nodePool, IRequestInvoker? requestInvoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + protected TransportConfiguration(TransportConfiguration original) + TransportConfiguration(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfiguration(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri cloudEndpoint, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfiguration(Uri? uri = null, ProductRegistration? productRegistration = null) + static readonly int DefaultConnectionLimit + static readonly TimeSpan DefaultDnsRefreshTimeout + string? Accept { get; } + IReadOnlyCollection? AllowedStatusCodes { get; init; } + AuthorizationHeader? Authentication { get; init; } + SemaphoreSlim BootstrapLock { get; } + string? CertificateFingerprint { get; init; } + X509CertificateCollection? ClientCertificates { get; init; } + int ConnectionLimit { get; init; } + string? ContentType { get; init; } + DateTimeProvider DateTimeProvider { get; } + TimeSpan? DeadTimeout { get; init; } + virtual bool DebugMode { get; init; } + static MemoryStreamFactory DefaultMemoryStreamFactory { get; } + bool? DisableAuditTrail { get; init; } + bool DisableAutomaticProxyDetection { get; init; } + bool? DisableDirectStreaming { get; init; } + bool DisableMetaHeader { get; init; } + bool? DisablePings { get; init; } + bool? DisableSniff { get; init; } + TimeSpan DnsRefreshTimeout { get; init; } + bool? EnableHttpCompression { get; init; } + bool? EnableTcpStats { get; init; } + bool? EnableThreadPoolStats { get; init; } + protected virtual Type EqualityContract { get; } + Uri? ForceNode { get; init; } + NameValueCollection? Headers { get; init; } + bool? HttpPipeliningEnabled { get; init; } + TimeSpan? KeepAliveInterval { get; init; } + TimeSpan? KeepAliveTime { get; init; } + TimeSpan? MaxDeadTimeout { get; init; } + int? MaxRetries { get; init; } + TimeSpan? MaxRetryTimeout { get; init; } + MemoryStreamFactory MemoryStreamFactory { get; init; } + MetaHeaderProvider? MetaHeaderProvider { get; init; } + NodePool NodePool { get; } + Func? NodePredicate { get; init; } + Action? OnConfigurationBound { get; init; } + Action? OnRequestCompleted { get; init; } + string? OpaqueId { get; init; } + bool? ParseAllHeaders { get; init; } + TimeSpan? PingTimeout { get; init; } + RequestPipelineFactory PipelineProvider { get; init; } + bool PrettyJson { get; init; } + ProductRegistration ProductRegistration { get; } + string? ProxyAddress { get; init; } + string? ProxyPassword { get; init; } + string? ProxyUsername { get; init; } + NameValueCollection? QueryStringParameters { get; init; } + IRequestInvoker RequestInvoker { get; } + RequestMetaData? RequestMetaData { get; init; } + Serializer RequestResponseSerializer { get; } + TimeSpan? RequestTimeout { get; init; } + IReadOnlyCollection ResponseBuilders { get; init; } + HeadersList? ResponseHeadersToParse { get; init; } + string? RunAs { get; init; } + Func? ServerCertificateValidationCallback { get; init; } + IReadOnlyCollection? SkipDeserializationForStatusCodes { get; init; } + TimeSpan? SniffInformationLifeSpan { get; init; } + bool SniffsOnConnectionFault { get; init; } + bool SniffsOnStartup { get; init; } + Func StatusCodeToResponseSuccess { get; init; } + bool? ThrowExceptions { get; init; } + bool? TransferEncodingChunked { get; init; } + UrlFormatter UrlFormatter { get; init; } + UserAgent UserAgent { get; init; } + virtual TransportConfiguration $() + void Dispose() + virtual bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected virtual bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(TransportConfiguration? left, TransportConfiguration? right) + static bool operator !=(TransportConfiguration? left, TransportConfiguration? right) + + class TransportConfigurationDescriptor : TransportConfigurationDescriptorBase + TransportConfigurationDescriptor(ITransportConfiguration config) + TransportConfigurationDescriptor(NodePool nodePool, IRequestInvoker? invoker = null, Serializer? serializer = null, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, ApiKey credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, CloudService service, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(string cloudId, BasicAuthentication credentials, ProductRegistration? productRegistration = null) + TransportConfigurationDescriptor(Uri? uri = null, ProductRegistration? productRegistration = null) + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + abstract class TransportConfigurationDescriptorBase : ITransportConfiguration, IRequestConfiguration, IDisposable where T : TransportConfigurationDescriptorBase + protected TransportConfigurationDescriptorBase(ITransportConfiguration config) + protected TransportConfigurationDescriptorBase(NodePool nodePool, IRequestInvoker? requestInvoker, Serializer? requestResponseSerializer, ProductRegistration? productRegistration) + protected Serializer UseThisRequestResponseSerializer { get; set; } + protected T Assign(TValue value, Action assigner) + T Authentication(AuthorizationHeader header) + T CertificateFingerprint(string fingerprint) + T ClientCertificate(X509Certificate certificate) + T ClientCertificate(string certificatePath) + T ClientCertificates(X509CertificateCollection certificates) + T ConnectionLimit(int connectionLimit) + T DeadTimeout(TimeSpan timeout) + T DisableAuditTrail(bool b = true) + T DisableAutomaticProxyDetection(bool disable = true) + T DisableDirectStreaming(bool b = true) + T DisableMetaHeader(bool disable = true) + T DisablePing(bool disable = true) + protected virtual void DisposeManagedResources() + T DnsRefreshTimeout(TimeSpan timeout) + virtual T EnableDebugMode(Action? onRequestCompleted = null) + T EnableHttpCompression(bool enabled = true) + T EnableHttpPipelining(bool enabled = true) + T EnableTcpKeepAlive(TimeSpan keepAliveTime, TimeSpan keepAliveInterval) + T EnableTcpStats(bool enableTcpStats = true) + T EnableThreadPoolStats(bool enableThreadPoolStats = true) + T GlobalHeaders(NameValueCollection headers) + T GlobalQueryStringParameters(NameValueCollection queryStringParameters) + T MaxDeadTimeout(TimeSpan timeout) + T MaxRetryTimeout(TimeSpan maxRetryTimeout) + T MaximumRetries(int maxRetries) + T MemoryStreamFactory(MemoryStreamFactory memoryStreamFactory) + T NodePredicate(Func predicate) + T OnBoundConfigurationCreated(Action handler) + T OnRequestCompleted(Action handler) + virtual T ParseAllHeaders(bool b = true) + T PingTimeout(TimeSpan timeout) + T PipelineProvider(RequestPipelineFactory provider) + virtual T PrettyJson(bool b = true) + T Proxy(Uri proxyAddress, string username, string password) + T Proxy(Uri proxyAddress) + T RequestTimeout(TimeSpan timeout) + T ResponseBuilder(IResponseBuilder responseBuilder) + virtual T ResponseHeadersToParse(HeadersList headersToParse) + T ServerCertificateValidationCallback(Func callback) + T SkipDeserializationForStatusCodes(params int[] statusCodes) + T SniffLifeSpan(TimeSpan? sniffLifeSpan) + T SniffOnConnectionFault(bool sniffsOnConnectionFault = true) + T SniffOnStartup(bool sniffsOnStartup = true) + T ThrowExceptions(bool alwaysThrow = true) + T TransferEncodingChunked(bool transferEncodingChunked = true) + protected T UpdateGlobalQueryString(string key, string value, bool enabled) + T UserAgent(UserAgent userAgent) + + class TransportException : Exception + TransportException(PipelineFailure failure, string message, TransportResponse response) + TransportException(PipelineFailure failure, string message, Exception? innerException = null) + TransportException(string message) + ApiCallDetails? ApiCallDetails { get; } + IReadOnlyCollection? AuditTrail { get; } + string DebugInformation { get; } + Endpoint? Endpoint { get; } + PipelineFailure? FailureReason { get; } + + static class TransportExtensions + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData, IRequestConfiguration configuration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, in EndpointPath path) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path, PostData? postData) where TResponse : TransportResponse, new() + static TResponse Request(this ITransport transport, HttpMethod method, string path) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, in EndpointPath path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, IRequestConfiguration localConfiguration, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, PostData? postData, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task RequestAsync(this ITransport transport, HttpMethod method, string path, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + static class TransportHttpMethodExtensions + static TResponse Delete(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default) where TResponse : TransportResponse, new() + static TResponse Delete(this ITransport transport, string path, RequestParameters parameters, PostData? data = null) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string pathAndQuery, PostData? data = null, TimeSpan? timeout = default, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task DeleteAsync(this ITransport transport, string path, RequestParameters parameters, PostData? data = null, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string pathAndQuery) where TResponse : TransportResponse, new() + static TResponse Get(this ITransport transport, string path, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task GetAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static VoidResponse Head(this ITransport transport, string pathAndQuery, TimeSpan timeout) + static VoidResponse Head(this ITransport transport, string pathAndQuery) + static VoidResponse Head(this ITransport transport, string path, RequestParameters parameters) + static Task HeadAsync(this ITransport transport, string pathAndQuery, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string pathAndQuery, TimeSpan timeout, CancellationToken cancellationToken = default) + static Task HeadAsync(this ITransport transport, string path, RequestParameters parameters, CancellationToken cancellationToken = default) + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Post(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PostAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string pathAndQuery, PostData data) where TResponse : TransportResponse, new() + static TResponse Put(this ITransport transport, string path, PostData data, RequestParameters parameters) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string pathAndQuery, PostData data, TimeSpan timeout, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + static Task PutAsync(this ITransport transport, string path, PostData data, RequestParameters parameters, CancellationToken cancellationToken = default) where TResponse : TransportResponse, new() + + abstract class TransportResponse + protected TransportResponse() + [JsonIgnore] + ApiCallDetails ApiCallDetails { get; } + [JsonIgnore] + protected internal virtual bool LeaveOpen { get; } + [JsonIgnore] + protected internal IEnumerable? LinkedDisposables { get; } + override string ToString() + + abstract class TransportResponse : TransportResponse + protected TransportResponse() + T Body { get; protected internal set; } + + class TransportSerializerOptionsProvider : IJsonSerializerOptionsProvider + TransportSerializerOptionsProvider() + TransportSerializerOptionsProvider(IReadOnlyCollection bakedInConverters, IReadOnlyCollection? userProvidedConverters, Action? mutateOptions = null) + JsonSerializerOptions CreateJsonSerializerOptions() + + abstract class TypedResponseBuilder : IResponseBuilder + protected TypedResponseBuilder() + protected abstract TResponse Build(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength) + protected abstract Task BuildAsync(ApiCallDetails apiCallDetails, BoundConfiguration boundConfiguration, Stream responseStream, string contentType, long contentLength, CancellationToken cancellationToken = default) + + class UnexpectedTransportException : TransportException + UnexpectedTransportException(Exception killerException, IReadOnlyCollection? seenExceptions) + IReadOnlyCollection SeenExceptions { get; } + + sealed class UrlFormatter : IFormatProvider, ICustomFormatter + UrlFormatter(ITransportConfiguration settings) + static string CreateString(object? value, ITransportConfiguration settings) + string CreateString(object? value) + string Format(string? format, object? arg, IFormatProvider? formatProvider) + object? GetFormat(Type? formatType) + + sealed class UserAgent + static UserAgent Create(string reposName, Type typeVersionLookup, string[] metadata) + static UserAgent Create(string reposName, Type typeVersionLookup) + static UserAgent Create(string fullUserAgentString) + override string ToString() + + abstract class VersionInfo + protected VersionInfo(SemVersion version) + bool IsPrerelease { get; } + int Major { get; } + string? Metadata { get; } + int Minor { get; } + int Patch { get; } + string? Prerelease { get; } + string ToMetadataHeaderValue() + override string ToString() + + sealed class VoidResponse : TransportResponse + VoidResponse() + static VoidResponse Default { get; } + class VoidBody + VoidBody() + +namespace Elastic.Transport.Diagnostics + static class OpenTelemetry + const string ElasticTransportActivitySourceName = "Elastic.Transport" + static bool ElasticTransportActivitySourceHasListeners { get; } + + class ThreadPoolStatistics + ThreadPoolStatistics(int min, int max, int busy, int free) + int Busy { get; } + int Free { get; } + int Max { get; } + int Min { get; } + + static class ThreadPoolStats + static ReadOnlyDictionary GetStats() + + abstract class TypedDiagnosticObserver : IObserver> + protected TypedDiagnosticObserver(Action> onNextStart, Action> onNextEnd, Action? onError = null, Action? onCompleted = null) + +namespace Elastic.Transport.Diagnostics.Auditing + sealed class Audit + DateTimeOffset Ended { get; } + AuditEvent Event { get; } + Exception? Exception { get; } + Node? Node { get; } + DateTimeOffset Started { get; } + override string ToString() + + enum AuditEvent + SniffOnStartup = 0 + SniffOnFail = 1 + SniffOnStaleCluster = 2 + SniffSuccess = 3 + SniffFailure = 4 + PingSuccess = 5 + PingFailure = 6 + Resurrection = 7 + AllNodesDead = 8 + BadResponse = 9 + HealthyResponse = 10 + MaxTimeoutReached = 11 + MaxRetriesReached = 12 + BadRequest = 13 + NoNodesAttempted = 14 + CancellationRequested = 15 + FailedOverAllNodes = 16 + + class Auditor : IReadOnlyCollection, IEnumerable, IEnumerable + int Count { get; } + void Emit(AuditEvent type, Node node) + void Emit(AuditEvent type) + IEnumerator GetEnumerator() + +namespace Elastic.Transport.Extensions + sealed class SemVersion : IEquatable, IComparable, IComparable + SemVersion(int major, int minor, int patch, string? prerelease, string? metadata) + SemVersion(int major, int minor, int patch, string? prerelease) + SemVersion(int major, int minor, int patch) + int Major { get; } + string Metadata { get; } + int Minor { get; } + int Patch { get; } + string Prerelease { get; } + int CompareByPrecedence(SemVersion? other) + int CompareTo(SemVersion? other) + int CompareTo(object? obj) + bool Equals(SemVersion? other) + override bool Equals(object? obj) + override int GetHashCode() + override string ToString() + static bool TryParse(string input, [NotNullWhen(true)] out SemVersion? version) + SemVersion Update(int? major = default, int? minor = default, int? patch = default, string? prerelease = null, string? metadata = null) + static bool operator ==(SemVersion left, SemVersion right) + static bool operator >(SemVersion left, SemVersion right) + static bool operator >=(SemVersion left, SemVersion right) + static bool operator !=(SemVersion left, SemVersion right) + static bool operator <(SemVersion left, SemVersion right) + static bool operator <=(SemVersion left, SemVersion right) + + static class TransportSerializerExtensions + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, ReadOnlySpan span, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, ReadOnlySpan span, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, string input, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, string input, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, JsonElement node, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, JsonElement node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, JsonNode node, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, JsonNode node, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static T? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static object? Deserialize(this Serializer serializer, ref Utf8JsonReader reader, Type type, MemoryStreamFactory? memoryStreamFactory = null) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, T? data, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static void Serialize(this Serializer serializer, object? data, Type type, Utf8JsonWriter writer, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static byte[] SerializeToBytes(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static byte[] SerializeToBytes(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static string SerializeToString(this Serializer serializer, T? data, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, T? data, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static string SerializeToString(this Serializer serializer, object? data, Type type, MemoryStreamFactory? memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.None) + static string SerializeToString(this Serializer serializer, object? data, Type type, SerializationFormatting formatting = SerializationFormatting.None) + [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode", Justification = "We always provide a static JsonTypeInfoResolver")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "We always provide a static JsonTypeInfoResolver")] + static bool TryGetJsonSerializerOptions(this Serializer serializer, [NotNullWhen(true)] out JsonSerializerOptions? options, SerializationFormatting formatting = SerializationFormatting.None) + +namespace Elastic.Transport.Products + sealed class DefaultProductRegistration : ProductRegistration + DefaultProductRegistration() + static DefaultProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override HeadersList ResponseHeadersToParse { get; } + override string? ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ProductRegistration + protected ProductRegistration() + abstract string? DefaultContentType { get; } + abstract IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + abstract MetaHeaderProvider MetaHeaderProvider { get; } + abstract string Name { get; } + abstract string ProductAssemblyVersion { get; } + virtual IReadOnlyCollection ResponseBuilders { get; } + abstract HeadersList ResponseHeadersToParse { get; } + abstract string? ServiceIdentifier { get; } + abstract bool SupportsPing { get; } + abstract bool SupportsSniff { get; } + abstract Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + abstract Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + abstract IReadOnlyCollection DefaultHeadersToParse() + abstract bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + virtual bool IsErrorContentType(string? contentType) + virtual bool IsExpectedResponseContentType(string accept, string? responseContentType) + virtual bool IsJsonContentType(string? contentType) + virtual bool IsValidResponse(ApiCallDetails? details) + abstract bool NodePredicate(Node node) + abstract Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + abstract TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + abstract Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + abstract int SniffOrder(Node node) + virtual string? TransformContentType(string? contentType) + virtual ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + abstract bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + +namespace Elastic.Transport.Products.Elasticsearch + record ElasticsearchConfiguration : TransportConfiguration, IEquatable + protected ElasticsearchConfiguration(ElasticsearchConfiguration original) + ElasticsearchConfiguration(string cloudId, ApiKey credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, ApiKey credentials) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials, CloudService service) + ElasticsearchConfiguration(string cloudId, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, ApiKey credentials) + ElasticsearchConfiguration(Uri cloudEndpoint, BasicAuthentication credentials) + ElasticsearchConfiguration(Uri? uri = null) + protected override Type EqualityContract { get; } + override ElasticsearchConfiguration $() + virtual bool Equals(ElasticsearchConfiguration? other) + sealed override bool Equals(TransportConfiguration? other) + override bool Equals(object? obj) + override int GetHashCode() + protected override bool PrintMembers(StringBuilder builder) + override string ToString() + static bool operator ==(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + static bool operator !=(ElasticsearchConfiguration? left, ElasticsearchConfiguration? right) + + sealed class ElasticsearchDynamicResponse : DynamicResponseBase, IElasticsearchResponse + ElasticsearchDynamicResponse() + ElasticsearchDynamicResponse(DynamicDictionary dictionary) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchErrorExtensions + static bool TryGetElasticsearchServerError(this BytesResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this StringResponse response, out ElasticsearchServerError? serverError) + static bool TryGetElasticsearchServerError(this TransportResponse response, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchJsonResponse : JsonResponseBase, IElasticsearchResponse + ElasticsearchJsonResponse() + ElasticsearchJsonResponse(JsonNode node) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + static class ElasticsearchNodeFeatures + static readonly IReadOnlyCollection Default + const string HoldsData = "node.data" + const string HttpEnabled = "node.http" + const string IngestEnabled = "node.ingest" + const string MasterEligible = "node.master" + static readonly IReadOnlyCollection MasterEligibleOnly + static readonly IReadOnlyCollection NotMasterEligible + + sealed class ElasticsearchPipeResponse : PipeResponseBase, IElasticsearchResponse + ElasticsearchPipeResponse() + ElasticsearchPipeResponse(Stream responseStream, string? contentType) + PipeReader Body { get; } + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + class ElasticsearchProductRegistration : ProductRegistration + ElasticsearchProductRegistration(Type markerType) + const string SniffPath = "_nodes/http,settings" + static ProductRegistration Default { get; } + override string? DefaultContentType { get; } + override IReadOnlyDictionary? DefaultOpenTelemetryAttributes { get; } + override MetaHeaderProvider MetaHeaderProvider { get; } + override string Name { get; } + override string ProductAssemblyVersion { get; } + override IReadOnlyCollection ResponseBuilders { get; } + override HeadersList ResponseHeadersToParse { get; } + sealed override string ServiceIdentifier { get; } + override bool SupportsPing { get; } + override bool SupportsSniff { get; } + override Endpoint CreatePingEndpoint(Node node, IRequestConfiguration requestConfiguration) + override Endpoint CreateSniffEndpoint(Node node, IRequestConfiguration requestConfiguration, ITransportConfiguration settings) + override IReadOnlyCollection DefaultHeadersToParse() + override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) + override bool IsErrorContentType(string? contentType) + override bool IsExpectedResponseContentType(string accept, string? responseContentType) + override bool IsJsonContentType(string? contentType) + override bool IsValidResponse(ApiCallDetails? details) + override bool NodePredicate(Node node) + override Dictionary? ParseOpenTelemetryAttributesFromApiCallDetails(ApiCallDetails callDetails) + override TransportResponse Ping(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task PingAsync(IRequestInvoker requestInvoker, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override Tuple> Sniff(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration) + override Task>> SniffAsync(IRequestInvoker requestInvoker, bool forceSsl, Endpoint endpoint, BoundConfiguration boundConfiguration, CancellationToken cancellationToken) + override int SniffOrder(Node node) + override string? TransformContentType(string? contentType) + override ErrorResponse? TryExtractError(BoundConfiguration boundConfiguration, Stream responseStream) + override bool TryGetServerErrorReason(TResponse response, out string? reason) where TResponse : TransportResponse + + abstract class ElasticsearchResponse : TransportResponse, IElasticsearchResponse + protected ElasticsearchResponse() + [JsonIgnore] + string DebugInformation { get; } + [JsonIgnore] + ElasticsearchServerError? ElasticsearchServerError { get; } + [JsonIgnore] + IEnumerable ElasticsearchWarnings { get; } + [JsonIgnore] + virtual bool IsValidResponse { get; } + protected virtual void DebugIsValid(StringBuilder sb) + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ElasticsearchServerError : ErrorResponse + ElasticsearchServerError() + ElasticsearchServerError(Error error, int? statusCode) + [DataMember(Name = "error")] + [JsonPropertyName("error")] + Error? Error { get; init; } + [DataMember(Name = "status")] + [JsonPropertyName("status")] + int Status { get; init; } + static ElasticsearchServerError Create(Stream stream) + static ValueTask CreateAsync(Stream stream, CancellationToken token = default) + override bool HasError() + override string ToString() + static bool TryCreate(Stream stream, out ElasticsearchServerError? serverError) + + sealed class ElasticsearchStreamResponse : StreamResponseBase, IElasticsearchResponse + ElasticsearchStreamResponse() + ElasticsearchStreamResponse(Stream body, string? contentType) + Stream Body { get; } + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + sealed class ElasticsearchStringResponse : StringResponseBase, IElasticsearchResponse + ElasticsearchStringResponse() + ElasticsearchStringResponse(string body) + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + override string ToString() + bool TryGetOriginalException(out Exception? exception) + + [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.15.2326")] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] + [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ErrorCause))] + [JsonSerializable(typeof(System.Collections.Generic.Dictionary`2[[System.String, System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.Object, System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Collections, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyCollection`1[Elastic.Transport.Products.Elasticsearch.ErrorCause], System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.Collections.Generic.IReadOnlyDictionary`2[[System.String, System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.String, System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.Object[], System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a))] + [JsonSerializable(typeof(System.String))] + [JsonSerializable(typeof(System.Text.Json.JsonElement))] + [JsonSourceGenerationOptions(GenerationMode = (JsonSourceGenerationMode)0, UseStringEnumConverter = true)] + class ElasticsearchTransportSerializerContext : JsonSerializerContext, IJsonTypeInfoResolver + ElasticsearchTransportSerializerContext() + ElasticsearchTransportSerializerContext(JsonSerializerOptions options) + static ElasticsearchTransportSerializerContext Default { get; } + JsonTypeInfo> DictionaryStringObject { get; } + JsonTypeInfo ElasticsearchResponse { get; } + JsonTypeInfo ElasticsearchServerError { get; } + JsonTypeInfo Error { get; } + JsonTypeInfo ErrorCause { get; } + protected override JsonSerializerOptions? GeneratedSerializerOptions { get; } + JsonTypeInfo> IReadOnlyCollectionErrorCause { get; } + JsonTypeInfo> IReadOnlyDictionaryStringString { get; } + JsonTypeInfo Int32 { get; } + JsonTypeInfo JsonElement { get; } + JsonTypeInfo Object { get; } + JsonTypeInfo ObjectArray { get; } + JsonTypeInfo String { get; } + override JsonTypeInfo? GetTypeInfo(Type type) + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.Products.Elasticsearch.ErrorConverter))] + sealed class Error : ErrorCause + Error() + [JsonPropertyName("headers")] + IReadOnlyDictionary Headers { get; set; } + [JsonPropertyName("root_cause")] + IReadOnlyCollection? RootCause { get; set; } + override string ToString() + + [DataContract] + [JsonConverter(typeof(Elastic.Transport.ErrorCauseConverter))] + class ErrorCause + ErrorCause() + IReadOnlyDictionary AdditionalProperties { get; } + ErrorCause? CausedBy { get; } + string? Index { get; } + string? IndexUUID { get; } + string? Reason { get; } + [JsonPropertyName("stack_trace")] + string? StackTrace { get; } + string? Type { get; } + override string ToString() + + sealed class ErrorConverter : JsonConverter + ErrorConverter() + override Error? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + override void Write(Utf8JsonWriter writer, Error value, JsonSerializerOptions options) + + interface IElasticsearchResponse + string DebugInformation { get; } + ElasticsearchServerError? ElasticsearchServerError { get; } + IEnumerable ElasticsearchWarnings { get; } + bool IsValidResponse { get; } + bool TryGetOriginalException(out Exception? exception) + + [DataContract] + sealed class ShardFailure + ShardFailure() + [JsonPropertyName("index")] + string? Index { get; set; } + [JsonPropertyName("node")] + string? Node { get; set; } + [JsonPropertyName("reason")] + ErrorCause? Reason { get; set; } + [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)] + [JsonPropertyName("shard")] + int? Shard { get; set; } + [JsonPropertyName("status")] + string? Status { get; set; } + + static class SniffParser + static Regex AddressRegex { get; } + static Uri ParseToUri(string boundAddress, bool forceHttp) diff --git a/tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/VirtualizedClusterPublicApiIsUnchanged.verified.api b/tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/VirtualizedClusterPublicApiIsUnchanged.verified.api new file mode 100644 index 00000000..5c902e70 --- /dev/null +++ b/tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/VirtualizedClusterPublicApiIsUnchanged.verified.api @@ -0,0 +1,211 @@ +assembly Elastic.Transport.VirtualizedCluster +using Elastic.Transport: BoundConfiguration, DateTimeProvider, Endpoint, IRequestConfiguration, ITransport<>, ITransportConfiguration, Node, NodePool, PostData, RequestConfigurationDescriptor, RequestPipeline, RequestPipelineFactory, ResponseFactory, TransportConfigurationDescriptor, TransportException, TransportResponse, UnexpectedTransportException +using interface Elastic.Transport: IRequestInvoker +using Elastic.Transport.Diagnostics.Auditing: Audit +using struct Elastic.Transport.Diagnostics.Auditing: AuditEvent +using Elastic.Transport.Products: ProductRegistration +using System: Action<,>, Action<>, Exception, Func<,,>, Func<,>, Func<> +using struct System: DateTimeOffset, TimeSpan +using interface System: IDisposable +using System.Collections.Generic: IEnumerable<>, IList<>, IReadOnlyList<>, List<> +using struct System.Threading: CancellationToken +using System.Threading.Tasks: Task<> + +namespace Elastic.Transport.VirtualizedCluster + static class Virtual + static ElasticsearchClusterFactory Elasticsearch { get; } + +namespace Elastic.Transport.VirtualizedCluster.Audit + sealed class Auditor + Auditor(Func setup) + Action AssertPoolAfterCall { get; set; } + Action AssertPoolAfterStartup { get; set; } + Action AssertPoolBeforeCall { get; set; } + Action AssertPoolBeforeStartup { get; set; } + IEnumerable AsyncAuditTrail { get; set; } + IEnumerable AuditTrail { get; set; } + Func Cluster { get; } + TransportResponse Response { get; } + TransportResponse ResponseAsync { get; } + void ChangeTime(Func selector) + Task TraceCall(ClientCall callTrace, int nthCall = 0) + Task TraceCalls(params ClientCall[] audits) + Task TraceElasticsearchException(ClientCall callTrace, Action assert) + Task TraceElasticsearchExceptionOnResponse(ClientCall callTrace, Action assert) + Task TraceStartup(ClientCall callTrace = null) + Task TraceUnexpectedException(ClientCall callTrace, Action assert) + Task TraceUnexpectedTransportException(ClientCall callTrace, Action assert) + void VisualizeCalls(int numberOfCalls) + + sealed class CallTraceState + CallTraceState(AuditEvent e) + Action AssertWithBecause { get; set; } + AuditEvent Event { get; } + int? Port { get; set; } + Action SimpleAssert { get; set; } + + sealed class ClientCall : List + ClientCall() + ClientCall(Func requestOverrides) + Action AssertPoolAfterCall { get; } + Action AssertResponse { get; } + Func RequestOverrides { get; } + void Add(AuditEvent key, Action value) + void Add(AuditEvent key, int port, Action assertResponse) + void Add(AuditEvent key, int port) + void Add(AuditEvent key) + void Add(Action pool) + +namespace Elastic.Transport.VirtualizedCluster.Components + sealed class ExposingPipelineFactory : RequestPipelineFactory where TConfiguration : class, ITransportConfiguration + ExposingPipelineFactory(TConfiguration configuration) + ITransport Transport { get; } + override RequestPipeline Create(BoundConfiguration boundConfiguration) + + sealed class SealedVirtualCluster : IDisposable + VirtualizedCluster AllDefaults() + void Dispose() + VirtualizedCluster Settings(Func selector) + VirtualClusterRequestInvoker VirtualClusterConnection(Func selector = null) + + class VirtualCluster + protected VirtualCluster(IEnumerable nodes, MockProductRegistration productRegistration) + List ClientCallRules { get; } + protected List InternalNodes { get; } + IReadOnlyList Nodes { get; } + List PingingRules { get; } + MockProductRegistration ProductRegistration { get; } + List SniffingRules { get; } + VirtualCluster ClientCalls(Func selector) + VirtualCluster Ping(Func selector) + VirtualCluster PublishAddress(string publishHost) + SealedVirtualCluster SingleNodeConnection(Func, IEnumerable> seedNodesSelector = null) + VirtualCluster Sniff(Func selector) + VirtualCluster SniffElasticsearchVersionNumber(string version) + VirtualCluster SniffShouldReturnFqdn() + SealedVirtualCluster SniffingNodePool(Func, IEnumerable> seedNodesSelector = null) + SealedVirtualCluster StaticNodePool(Func, IEnumerable> seedNodesSelector = null) + SealedVirtualCluster StickyNodePool(Func, IEnumerable> seedNodesSelector = null) + SealedVirtualCluster StickySniffingNodePool(Func sorter = null, Func, IEnumerable> seedNodesSelector = null) + + class VirtualClusterRequestInvoker : IRequestInvoker, IDisposable + ResponseFactory ResponseFactory { get; } + static VirtualClusterRequestInvoker Error() + TResponse Request(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData) where TResponse : TransportResponse, new() + Task RequestAsync(Endpoint endpoint, BoundConfiguration boundConfiguration, PostData? postData, CancellationToken cancellationToken) where TResponse : TransportResponse, new() + static VirtualClusterRequestInvoker Success(byte[] response) + + class VirtualizedCluster + VirtualClusterRequestInvoker Connection { get; } + NodePool ConnectionPool { get; } + ITransport RequestHandler { get; } + void ChangeTime(Func change) + TransportResponse ClientCall(Func requestOverrides = null) + Task ClientCallAsync(Func requestOverrides = null) + void ClientThrows(bool throws) + VirtualizedCluster TransportProxiesTo(Func, Func, TransportResponse> sync, Func, Func, Task> async) + +namespace Elastic.Transport.VirtualizedCluster.Products + abstract class MockProductRegistration + protected MockProductRegistration() + abstract ProductRegistration ProductRegistration { get; } + abstract byte[] CreateSniffResponseBytes(IReadOnlyList nodes, string stackVersion, string publishAddressOverride, bool returnFullyQualifiedDomainNames) + abstract bool IsPingRequest(Endpoint endpoint) + abstract bool IsSniffRequest(Endpoint endpoint) + +namespace Elastic.Transport.VirtualizedCluster.Products.Elasticsearch + sealed class ElasticsearchClusterFactory + ElasticsearchVirtualCluster Bootstrap(IEnumerable nodes) + ElasticsearchVirtualCluster Bootstrap(int numberOfNodes, int startFrom = 9200) + ElasticsearchVirtualCluster BootstrapAllMasterEligableOnly(int numberOfNodes, int startFrom = 9200) + + sealed class ElasticsearchMockProductRegistration : MockProductRegistration + ElasticsearchMockProductRegistration() + static MockProductRegistration Default { get; } + override ProductRegistration ProductRegistration { get; } + override byte[] CreateSniffResponseBytes(IReadOnlyList nodes, string stackVersion, string publishAddressOverride, bool returnFullyQualifiedDomainNames) + override bool IsPingRequest(Endpoint endpoint) + override bool IsSniffRequest(Endpoint endpoint) + + static class ElasticsearchSniffResponseFactory + static byte[] Create(IEnumerable nodes, string elasticsearchVersion, string publishAddressOverride, bool randomFqdn = false) + + class ElasticsearchVirtualCluster : VirtualCluster + ElasticsearchVirtualCluster(IEnumerable nodes) + ElasticsearchVirtualCluster HasSetting(string key, string value, params int[] ports) + VirtualCluster HttpDisabled(params int[] ports) + ElasticsearchVirtualCluster MasterEligible(params int[] ports) + ElasticsearchVirtualCluster StoresNoData(params int[] ports) + +namespace Elastic.Transport.VirtualizedCluster.Providers + sealed class TestableDateTimeProvider : DateTimeProvider + TestableDateTimeProvider() + void ChangeTime(Func change) + override DateTimeOffset DeadTime(int attempts, TimeSpan? minDeadTimeout, TimeSpan? maxDeadTimeout) + override DateTimeOffset Now() + +namespace Elastic.Transport.VirtualizedCluster.Rules + sealed class ClientCallRule : RuleBase, IClientCallRule, IRule + ClientCallRule() + ClientCallRule AfterSucceeds(RuleOption errorState = null) + ClientCallRule FailAlways(RuleOption errorState = null) + ClientCallRule Fails(RuleOption times, RuleOption errorState = null) + ClientCallRule SucceedAlways(int? validResponseCode = 200) + ClientCallRule Succeeds(RuleOption times, int? validResponseCode = 200) + ClientCallRule ThrowsAfterSucceeds() + + interface IClientCallRule : IRule + + interface IRule + RuleOption AfterSucceeds { get; set; } + int ExecuteCount { get; } + int? OnPort { get; set; } + Func PathFilter { get; set; } + RuleOption Return { get; set; } + string ReturnContentType { get; set; } + byte[] ReturnResponse { get; set; } + bool Succeeds { get; set; } + TimeSpan? Takes { get; set; } + RuleOption Times { get; set; } + void RecordExecuted() + + interface ISniffRule : IRule + VirtualCluster NewClusterState { get; set; } + + sealed class PingRule : RuleBase + PingRule() + PingRule FailAlways(RuleOption errorState = null) + PingRule Fails(RuleOption times, RuleOption errorState = null) + PingRule SucceedAlways(int? validResponseCode = 200) + PingRule Succeeds(RuleOption times, int? validResponseCode = 200) + + abstract class RuleBase : IRule where TRule : RuleBase, IRule + protected RuleBase() + TRule OnPath(Func pathPredicate) + TRule OnPath(string pathContains) + TRule OnPort(int port) + TRule ReturnByteResponse(byte[] response, string responseContentType = "application/json") + TRule ReturnResponse(T response) where T : class + TRule Takes(TimeSpan span) + + sealed class RuleOption + RuleOption(TFirst item) + RuleOption(TSecond item) + void Match(Action first, Action second) + T Match(Func first, Func second) + static implicit operator RuleOption(TFirst first) + static implicit operator RuleOption(TSecond second) + + sealed class SniffRule : RuleBase, ISniffRule, IRule + SniffRule() + SniffRule FailAlways(RuleOption errorState = null) + SniffRule Fails(RuleOption times, RuleOption errorState = null) + SniffRule SucceedAlways(VirtualCluster cluster = null) + SniffRule Succeeds(RuleOption times, VirtualCluster cluster = null) + + static class TimesHelper + static readonly TimesHelper.AllTimes Always + static readonly int Once + static readonly int Twice + static int Times(int n) + class AllTimes diff --git a/tests/Elastic.Transport.PublicApi.Tests/Elastic.Transport.PublicApi.Tests.csproj b/tests/Elastic.Transport.PublicApi.Tests/Elastic.Transport.PublicApi.Tests.csproj new file mode 100644 index 00000000..8a77d4ef --- /dev/null +++ b/tests/Elastic.Transport.PublicApi.Tests/Elastic.Transport.PublicApi.Tests.csproj @@ -0,0 +1,30 @@ + + + + net10.0 + True + false + CS8002 + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + diff --git a/tests/Elastic.Transport.PublicApi.Tests/PublicApiTests.cs b/tests/Elastic.Transport.PublicApi.Tests/PublicApiTests.cs new file mode 100644 index 00000000..53f7214d --- /dev/null +++ b/tests/Elastic.Transport.PublicApi.Tests/PublicApiTests.cs @@ -0,0 +1,26 @@ +// 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 + +using AwesomeAssertions; +using Elastic.Transport; +using Elastic.Transport.VirtualizedCluster.Components; +using Nullean.Snapshots.PublicApi; +using Xunit; + +namespace Elastic.Transport.PublicApi.Tests; + +/// +/// The public API of the libraries as net10.0 sees it, checked against the committed snapshots in .snapshots/. +/// A change to it fails the test until the new snapshot is accepted (snap accept); the api/ folder holds +/// every target framework and is checked in CI by ./build.sh verifyapi. +/// +public class PublicApiTests +{ + [Fact] + public void TransportPublicApiIsUnchanged() => typeof(ITransport).Assembly.Should().MatchApiSnapshot(); + + [Fact] + public void VirtualizedClusterPublicApiIsUnchanged() => + typeof(VirtualCluster).Assembly.Should().MatchApiSnapshot(); +} From d01daabbcbbff828850b59f8a04e70c60815a828 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 24 Nov 2026 15:51:51 +0100 Subject: [PATCH 05/12] Document how to change the public API Co-Authored-By: Claude Sonnet 5.5 --- contributing.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/contributing.md b/contributing.md index 299cc4c2..8c5bf2d3 100644 --- a/contributing.md +++ b/contributing.md @@ -71,3 +71,19 @@ The `tests` folder contains unit and integration tests. ``` ...with no target will run the `build` target, compiling the solution and running unit tests. + +## Changing the public API + +The public API of `Elastic.Transport` and `Elastic.Transport.VirtualizedCluster` is committed in `api/`, one `.api` file per target framework where they differ. Two checks keep it honest: + +- `./build.sh verifyapi` (and the `verify-api` job on every pull request) fails when `api/` no longer matches the Release build. +- `Elastic.Transport.PublicApi.Tests` checks the net10.0 API against `.snapshots/` and prints each change with the version bump it calls for. + +After an intended change, regenerate the files and commit them with the change. The diff of `api/` is the API change a reviewer reads: + +```bash +./build.sh api +SNAPSHOT_ACCEPT=1 dotnet test tests/Elastic.Transport.PublicApi.Tests -c Release +``` + +On a pull request the `api-changes` job comments with what the change does to the API compared with the latest release on nuget.org, and sets the `breaking` label for a major change or `feature` for a minor one. A breaking change fails the check until a maintainer adds the `breaking-allowed` label, which says the break is intended. From 6c6f6c95f9c486c1dbe3b8f127b043458ba6e9b3 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 24 Nov 2026 18:59:55 +0100 Subject: [PATCH 06/12] Use assembly-differ 1.3.0 and Nullean.Snapshots.PublicApi 0.18.1 Both leave GeneratedCode out of the public API files. The attribute held the SDK's System.Text.Json source generator version, so the committed files failed on CI's runner, whose SDK has another patch release. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/api-changes.yml | 4 ++-- api/Elastic.Transport.net10.0.api | 2 -- api/Elastic.Transport.net462.api | 2 -- api/Elastic.Transport.net8.0.api | 2 -- api/Elastic.Transport.netstandard2.0.api | 2 -- api/Elastic.Transport.netstandard2.1.api | 2 -- dotnet-tools.json | 2 +- .../PublicApiTests/TransportPublicApiIsUnchanged.verified.api | 2 -- .../Elastic.Transport.PublicApi.Tests.csproj | 2 +- 9 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/api-changes.yml b/.github/workflows/api-changes.yml index 6e900e0c..5fdb2373 100644 --- a/.github/workflows/api-changes.yml +++ b/.github/workflows/api-changes.yml @@ -28,7 +28,7 @@ jobs: - uses: nullean/assembly-differ@v1 with: - version: 1.2.1 + version: 1.3.0 # The committed api/*.api files must match the build: an intended change to the public API is committed with it. verify-api: @@ -44,7 +44,7 @@ jobs: - uses: nullean/assembly-differ/verify-api@v1 with: - version: 1.2.1 + version: 1.3.0 directory: api projects: | src/Elastic.Transport/Elastic.Transport.csproj diff --git a/api/Elastic.Transport.net10.0.api b/api/Elastic.Transport.net10.0.api index 8ca31d4b..097e4a47 100644 --- a/api/Elastic.Transport.net10.0.api +++ b/api/Elastic.Transport.net10.0.api @@ -2,7 +2,6 @@ assembly Elastic.Transport using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri using struct System: DateTime, DateTimeOffset, Guid, ReadOnlyMemory<>, ReadOnlySpan<>, TimeSpan, TypeCode using interface System: IAsyncDisposable, IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> -using System.CodeDom.Compiler: GeneratedCodeAttribute using interface System.Collections: IEnumerable using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> using struct System.Collections.Generic: KeyValuePair<,> @@ -1518,7 +1517,6 @@ namespace Elastic.Transport.Products.Elasticsearch override string ToString() bool TryGetOriginalException(out Exception? exception) - [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.15.2326")] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] diff --git a/api/Elastic.Transport.net462.api b/api/Elastic.Transport.net462.api index cd22127e..cfadd330 100644 --- a/api/Elastic.Transport.net462.api +++ b/api/Elastic.Transport.net462.api @@ -2,7 +2,6 @@ assembly Elastic.Transport using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri using struct System: DateTime, DateTimeOffset, Guid, ReadOnlySpan<>, TimeSpan, TypeCode using interface System: IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> -using System.CodeDom.Compiler: GeneratedCodeAttribute using interface System.Collections: IEnumerable using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> using struct System.Collections.Generic: KeyValuePair<,> @@ -1408,7 +1407,6 @@ namespace Elastic.Transport.Products.Elasticsearch override string ToString() bool TryGetOriginalException(out Exception? exception) - [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.13.2411")] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] diff --git a/api/Elastic.Transport.net8.0.api b/api/Elastic.Transport.net8.0.api index 53b9e670..af839fb8 100644 --- a/api/Elastic.Transport.net8.0.api +++ b/api/Elastic.Transport.net8.0.api @@ -2,7 +2,6 @@ assembly Elastic.Transport using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri using struct System: DateTime, DateTimeOffset, Guid, ReadOnlyMemory<>, ReadOnlySpan<>, TimeSpan, TypeCode using interface System: IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> -using System.CodeDom.Compiler: GeneratedCodeAttribute using interface System.Collections: IEnumerable using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> using struct System.Collections.Generic: KeyValuePair<,> @@ -1489,7 +1488,6 @@ namespace Elastic.Transport.Products.Elasticsearch override string ToString() bool TryGetOriginalException(out Exception? exception) - [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.13.2411")] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] diff --git a/api/Elastic.Transport.netstandard2.0.api b/api/Elastic.Transport.netstandard2.0.api index 49297185..e1636047 100644 --- a/api/Elastic.Transport.netstandard2.0.api +++ b/api/Elastic.Transport.netstandard2.0.api @@ -2,7 +2,6 @@ assembly Elastic.Transport using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri using struct System: DateTime, DateTimeOffset, Guid, ReadOnlySpan<>, TimeSpan, TypeCode using interface System: IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> -using System.CodeDom.Compiler: GeneratedCodeAttribute using interface System.Collections: IEnumerable using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> using struct System.Collections.Generic: KeyValuePair<,> @@ -1419,7 +1418,6 @@ namespace Elastic.Transport.Products.Elasticsearch override string ToString() bool TryGetOriginalException(out Exception? exception) - [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.13.2411")] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] diff --git a/api/Elastic.Transport.netstandard2.1.api b/api/Elastic.Transport.netstandard2.1.api index a63d937b..3cfbe085 100644 --- a/api/Elastic.Transport.netstandard2.1.api +++ b/api/Elastic.Transport.netstandard2.1.api @@ -2,7 +2,6 @@ assembly Elastic.Transport using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri using struct System: DateTime, DateTimeOffset, Guid, ReadOnlyMemory<>, ReadOnlySpan<>, TimeSpan, TypeCode using interface System: IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> -using System.CodeDom.Compiler: GeneratedCodeAttribute using interface System.Collections: IEnumerable using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> using struct System.Collections.Generic: KeyValuePair<,> @@ -1421,7 +1420,6 @@ namespace Elastic.Transport.Products.Elasticsearch override string ToString() bool TryGetOriginalException(out Exception? exception) - [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.13.2411")] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] diff --git a/dotnet-tools.json b/dotnet-tools.json index ebd4976a..e89c1934 100644 --- a/dotnet-tools.json +++ b/dotnet-tools.json @@ -10,7 +10,7 @@ "rollForward": false }, "assembly-differ": { - "version": "1.2.1", + "version": "1.3.0", "commands": [ "assembly-differ" ], diff --git a/tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/TransportPublicApiIsUnchanged.verified.api b/tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/TransportPublicApiIsUnchanged.verified.api index 8ca31d4b..097e4a47 100644 --- a/tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/TransportPublicApiIsUnchanged.verified.api +++ b/tests/Elastic.Transport.PublicApi.Tests/.snapshots/PublicApiTests/TransportPublicApiIsUnchanged.verified.api @@ -2,7 +2,6 @@ assembly Elastic.Transport using System: Action, Action<,>, Action<>, CLSCompliantAttribute, Exception, Func<,,,,>, Func<,,,>, Func<,,>, Func<,>, ObsoleteAttribute, Random, Tuple<,>, Type, Uri using struct System: DateTime, DateTimeOffset, Guid, ReadOnlyMemory<>, ReadOnlySpan<>, TimeSpan, TypeCode using interface System: IAsyncDisposable, IComparable, IComparable<>, IConvertible, ICustomFormatter, IDisposable, IEquatable<>, IFormatProvider, IObserver<> -using System.CodeDom.Compiler: GeneratedCodeAttribute using interface System.Collections: IEnumerable using System.Collections.Generic: Dictionary<,>, IEnumerator<>, IReadOnlyDictionary<,>, IReadOnlyList<>, List<> using struct System.Collections.Generic: KeyValuePair<,> @@ -1518,7 +1517,6 @@ namespace Elastic.Transport.Products.Elasticsearch override string ToString() bool TryGetOriginalException(out Exception? exception) - [GeneratedCode("System.Text.Json.SourceGeneration", "10.0.15.2326")] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.ElasticsearchServerError))] [JsonSerializable(typeof(Elastic.Transport.Products.Elasticsearch.Error))] diff --git a/tests/Elastic.Transport.PublicApi.Tests/Elastic.Transport.PublicApi.Tests.csproj b/tests/Elastic.Transport.PublicApi.Tests/Elastic.Transport.PublicApi.Tests.csproj index 8a77d4ef..92c0b2e6 100644 --- a/tests/Elastic.Transport.PublicApi.Tests/Elastic.Transport.PublicApi.Tests.csproj +++ b/tests/Elastic.Transport.PublicApi.Tests/Elastic.Transport.PublicApi.Tests.csproj @@ -20,7 +20,7 @@ - + From a3bdf55a9b5bd6baa6649175a44c36a0b12ce73d Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 24 Nov 2026 19:10:39 +0100 Subject: [PATCH 07/12] List assembly-differ last in the tool manifest dotnet tool restore on the Linux runner reported that release-notes and nupkg-validator, the two tools listed after assembly-differ 1.3.0, are not contained in their packages and that the packages only hold assembly-differ. Co-Authored-By: Claude Sonnet 5.5 --- dotnet-tools.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dotnet-tools.json b/dotnet-tools.json index e89c1934..550eba04 100644 --- a/dotnet-tools.json +++ b/dotnet-tools.json @@ -9,13 +9,6 @@ ], "rollForward": false }, - "assembly-differ": { - "version": "1.3.0", - "commands": [ - "assembly-differ" - ], - "rollForward": false - }, "release-notes": { "version": "0.10.0", "commands": [ @@ -29,6 +22,13 @@ "nupkg-validator" ], "rollForward": false + }, + "assembly-differ": { + "version": "1.3.0", + "commands": [ + "assembly-differ" + ], + "rollForward": false } } -} \ No newline at end of file +} From 5c3a6e60cc5192391785f33be29abfbd86b88b1c Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 25 Nov 2026 15:09:01 +0100 Subject: [PATCH 08/12] Check out the tags in the API workflows MinVer builds version 0.x without tags, so the libraries differed from the 1.1.0 release in the version of the assemblies they reference and the comment reported a Patch change on unchanged code. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/api-changes.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/api-changes.yml b/.github/workflows/api-changes.yml index 5fdb2373..d88c33b1 100644 --- a/.github/workflows/api-changes.yml +++ b/.github/workflows/api-changes.yml @@ -19,6 +19,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + # MinVer reads the version from the tags: a shallow checkout builds 0.x, and the libraries then differ from + # the release in their own version and in the version of the assemblies they reference + fetch-depth: 0 - uses: actions/setup-dotnet@v4 with: @@ -35,6 +39,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + # MinVer reads the version from the tags: a shallow checkout builds 0.x, and the libraries then differ from + # the release in their own version and in the version of the assemblies they reference + fetch-depth: 0 - uses: actions/setup-dotnet@v4 with: From 434be8cb90f4a2ee2762464ec442a7e5d5a27982 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 25 Nov 2026 15:20:54 +0100 Subject: [PATCH 09/12] Run the public API checks in ci.yml The build job already builds Release and has the tags, so the checks run there instead of in a second workflow that built again: assembly-differ reports the change and sets the labels on a pull request, and verifyapi fails when api/ differs from the build. The workflow also runs on labeled and unlabeled, where only the API checks run, so adding breaking-allowed does not run the tests again. The api targets restore the tool manifest themselves. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/api-changes.yml | 60 ------------------------------- .github/workflows/ci.yml | 20 +++++++++++ build/scripts/Targets.fs | 2 ++ 3 files changed, 22 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/api-changes.yml diff --git a/.github/workflows/api-changes.yml b/.github/workflows/api-changes.yml deleted file mode 100644 index d88c33b1..00000000 --- a/.github/workflows/api-changes.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Public API - -on: - pull_request: - # labeled and unlabeled run the checks again when someone adds or removes breaking-allowed - types: [opened, synchronize, reopened, labeled, unlabeled] - paths-ignore: - - 'README.md' - - '.editorconfig' - -permissions: - contents: read - pull-requests: write # the comments and the labels - -jobs: - # What the pull request changes in the public API of the libraries, against their latest release on nuget.org. - # A breaking change fails the check until someone adds the breaking-allowed label. - api-changes: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - # MinVer reads the version from the tags: a shallow checkout builds 0.x, and the libraries then differ from - # the release in their own version and in the version of the assemblies they reference - fetch-depth: 0 - - - uses: actions/setup-dotnet@v4 - with: - global-json-file: ./global.json - - - run: dotnet build -c Release - - - uses: nullean/assembly-differ@v1 - with: - version: 1.3.0 - - # The committed api/*.api files must match the build: an intended change to the public API is committed with it. - verify-api: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - # MinVer reads the version from the tags: a shallow checkout builds 0.x, and the libraries then differ from - # the release in their own version and in the version of the assemblies they reference - fetch-depth: 0 - - - uses: actions/setup-dotnet@v4 - with: - global-json-file: ./global.json - - - run: dotnet build -c Release - - - uses: nullean/assembly-differ/verify-api@v1 - with: - version: 1.3.0 - directory: api - projects: | - src/Elastic.Transport/Elastic.Transport.csproj - src/Elastic.Transport.VirtualizedCluster/Elastic.Transport.VirtualizedCluster.csproj - comment: 'true' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec2a8b13..65fbfea7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,8 @@ name: Always be deploying on: pull_request: + # labeled and unlabeled run the API check again when someone adds or removes breaking-allowed + types: [opened, synchronize, reopened, labeled, unlabeled] paths-ignore: - 'README.md' - '.editorconfig' @@ -18,9 +20,12 @@ permissions: contents: write issues: write packages: write + pull-requests: write # the API comment and labels jobs: aot-validate: + # adding a label only runs the API check again + if: github.event.action != 'labeled' && github.event.action != 'unlabeled' runs-on: ${{ matrix.os.runner }} strategy: fail-fast: false @@ -70,14 +75,29 @@ jobs: - run: ./build.sh build -s true name: Build + # What the pull request changes in the public API of the libraries, against their latest release on nuget.org: + # one comment, the release label, and a failure on a breaking change until someone adds breaking-allowed. + - uses: nullean/assembly-differ@v1 + name: Report the public API changes + if: github.event_name == 'pull_request' + with: + version: 1.3.0 + + # The committed api/*.api files must match the build: an intended change to the public API is committed with it. + - run: ./build.sh verifyapi -s true + name: Verify the committed public API files + - run: ./build.sh test -s true name: Test + if: github.event.action != 'labeled' && github.event.action != 'unlabeled' - run: ./build.sh generatepackages -s true name: Generate local nuget packages + if: github.event.action != 'labeled' && github.event.action != 'unlabeled' - run: ./build.sh validatepackages -s true name: "validate *.npkg files that were created" + if: github.event.action != 'labeled' && github.event.action != 'unlabeled' - name: publish canary packages github package repository if: github.event_name == 'push' && startswith(github.ref, 'refs/heads') diff --git a/build/scripts/Targets.fs b/build/scripts/Targets.fs index 163d95a8..4a6971ec 100644 --- a/build/scripts/Targets.fs +++ b/build/scripts/Targets.fs @@ -92,11 +92,13 @@ let private apiArgs (mode:string list) = // writes the public API of the Release build to api/, run it after an intended API change and commit the result let private writeApi (arguments:ParseResults) = + restoreTools.Value |> ignore exec "dotnet" ["build"; "-c"; "Release"] |> ignore exec "dotnet" (apiArgs ["-o"; "api"]) |> ignore // fails when api/ no longer matches the Release build let private verifyApi (arguments:ParseResults) = + restoreTools.Value |> ignore exec "dotnet" ["build"; "-c"; "Release"] |> ignore exec "dotnet" (apiArgs ["--verify"; "api"]) |> ignore From bda215726bea5f628db16c668d50e0c928075238 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 25 Nov 2026 15:27:29 +0100 Subject: [PATCH 10/12] Give each job in ci.yml only the permissions it needs The workflow-level token had contents, issues, packages and now pull-requests write on every pull request, including for the AOT jobs that publish and run pull request code. The workflow default is now none, the AOT jobs read contents, and the build job keeps what it had plus pull-requests write for the API comment. The assembly-differ action is pinned to the commit of its 1.3.0 release. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65fbfea7..38940da8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,16 +16,15 @@ on: tags: - "*.*.*" -permissions: - contents: write - issues: write - packages: write - pull-requests: write # the API comment and labels +# nothing by default: each job asks for what it needs +permissions: {} jobs: aot-validate: # adding a label only runs the API check again if: github.event.action != 'labeled' && github.event.action != 'unlabeled' + permissions: + contents: read # publishes and runs pull request code: no write token runs-on: ${{ matrix.os.runner }} strategy: fail-fast: false @@ -54,6 +53,11 @@ jobs: run: .artifacts/publish/transport-aot-example/release/${{ matrix.os.binary }} build: + permissions: + contents: write # the release for a tag + issues: write # as before the permissions moved here + packages: write # the canary packages + pull-requests: write # the API comment and labels on a pull request runs-on: ubuntu-latest steps: @@ -77,7 +81,7 @@ jobs: # What the pull request changes in the public API of the libraries, against their latest release on nuget.org: # one comment, the release label, and a failure on a breaking change until someone adds breaking-allowed. - - uses: nullean/assembly-differ@v1 + - uses: nullean/assembly-differ@47e5582d8c7d36d66815ded0952eeb9970510241 # 1.3.0 name: Report the public API changes if: github.event_name == 'pull_request' with: From 573a24a087ae49ef675022293800e3439113376c Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 25 Nov 2026 16:28:31 +0100 Subject: [PATCH 11/12] Check the API in one step and stop persisting checkout credentials assembly-differ 1.4.0 verifies the committed api/ files in the same action and the same comment, so the two steps become one on a pull request. A push and a tag still run verifyapi. Neither checkout keeps the token in git config, since nothing after it needs git credentials. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci.yml | 19 ++++++++++++++----- dotnet-tools.json | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38940da8..51a6ab47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,8 @@ jobs: binary: transport-aot-example.exe steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: actions/setup-dotnet@v4 with: @@ -64,6 +66,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 1 + persist-credentials: false - run: | git fetch --prune --unshallow --tags @@ -79,17 +82,23 @@ jobs: - run: ./build.sh build -s true name: Build - # What the pull request changes in the public API of the libraries, against their latest release on nuget.org: - # one comment, the release label, and a failure on a breaking change until someone adds breaking-allowed. - - uses: nullean/assembly-differ@47e5582d8c7d36d66815ded0952eeb9970510241 # 1.3.0 + # What the pull request changes in the public API of the libraries, against their latest release on nuget.org, and + # whether the committed api/*.api files match the build: one comment, the release label, and a failure on a + # breaking change until someone adds breaking-allowed, or on files that are out of date. + - uses: nullean/assembly-differ@89b7a68a9f34173d57ceef47a73d505f751cb086 # 1.4.0 name: Report the public API changes if: github.event_name == 'pull_request' with: - version: 1.3.0 + version: 1.4.0 + api-files: api + projects: | + src/Elastic.Transport/Elastic.Transport.csproj + src/Elastic.Transport.VirtualizedCluster/Elastic.Transport.VirtualizedCluster.csproj - # The committed api/*.api files must match the build: an intended change to the public API is committed with it. + # a push and a tag have no pull request to comment on, and still must not release out of date API files - run: ./build.sh verifyapi -s true name: Verify the committed public API files + if: github.event_name != 'pull_request' - run: ./build.sh test -s true name: Test diff --git a/dotnet-tools.json b/dotnet-tools.json index 550eba04..e50b89a3 100644 --- a/dotnet-tools.json +++ b/dotnet-tools.json @@ -24,7 +24,7 @@ "rollForward": false }, "assembly-differ": { - "version": "1.3.0", + "version": "1.4.0", "commands": [ "assembly-differ" ], From 0641db35a87d01c21c18482ec5ad2686acbe204b Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 25 Nov 2026 17:12:49 +0100 Subject: [PATCH 12/12] Publish from a job of its own, so pull request jobs have no write token (#233) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pull request jobs no longer hold a write token or the publishing secrets: the publish steps of `ci.yml` move into a job of their own that runs for a push to main and for a tag only. **Prompt summary:** After reviewing the permissions of the pull request checks in #232, the owner asked for the remaining finding to be fixed: the `build` job ran pull request code, and a third-party action, with `contents`, `issues` and `packages` write, only because the publish steps shared it. The change is its own pull request, apart from the API onboarding. ## Why The `build` job builds and tests the pull request, runs MSBuild tasks and source generators from its dependencies, and runs the assembly-differ action. It also pushed the canary and release packages, so it held `contents`, `issues` and `packages` write for every run, including pull requests from branches of this repository. A compromised dependency or action in that job could write to the repository's releases and packages. ## What #### A publish job `publish` has `needs: build` and `if: github.event_name == 'push'`. It holds `contents`, `issues` and `packages` write, and is the only job that names `FEEDZ_IO_API_KEY`, `NUGET_ORG_API_KEY` or the token for the release. It checks out the same commit, fetches the tags, restores the tools, and runs the same push steps with the same conditions as before: canary packages to GitHub Packages and feedz.io for a push to a branch; release notes, the GitHub release and nuget.org for a tag. #### What it publishes The `build` job already built, tested and validated the packages. On a push it uploads `build/output/*.nupkg` as an artifact that expires after a day, and `publish` downloads it into `build/output`. The packages that are pushed are the ones that were tested, not a rebuild. #### Build job permissions `build` now has `contents: read` and `pull-requests: write`, the comment and labels of the API step. `zizmor` finds nothing about permissions or secrets in `ci.yml`; the remaining findings are the `actions/*` tags that policy allows and three trusted-publishing notes. **Risk:** the publish steps only run for a push to main and for a tag, so a pull request cannot run them. I ran the hand-off on this pull request with a temporary commit, since reverted: both `.nupkg` files reached `build/output` in the `publish` job, which restored the tools and generated release notes. The pushes themselves first run when this merges, as canary packages from main, and the release steps with the next tag. A failed canary run only needs a rerun. **Stack:** 2 of 2, on top of [#232](https://github.com/elastic/elastic-transport-net/pull/232); retarget it to `main` once that merges. ## Verify ```bash git diff feature/assembly-differ -- .github/workflows/ci.yml ``` In the run of this pull request, the `build` job's "GITHUB_TOKEN Permissions" show `Contents: read` and `PullRequests: write`, and the `publish` job does not run. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 --- .github/workflows/ci.yml | 48 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51a6ab47..714bb340 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,9 +56,7 @@ jobs: build: permissions: - contents: write # the release for a tag - issues: write # as before the permissions moved here - packages: write # the canary packages + contents: read # builds and runs pull request code: no write token pull-requests: write # the API comment and labels on a pull request runs-on: ubuntu-latest steps: @@ -112,6 +110,50 @@ jobs: name: "validate *.npkg files that were created" if: github.event.action != 'labeled' && github.event.action != 'unlabeled' + # The packages the publish job pushes: built and validated here, from the commit that was tested, and kept for a day. + - uses: actions/upload-artifact@v4 + name: Keep the packages for the publish job + if: github.event_name == 'push' + with: + name: packages + path: build/output/*.nupkg + if-no-files-found: error + retention-days: 1 + + # The only job with a write token and the publishing secrets. It runs for a push to main and for a tag, never for a + # pull request, and only publishes what the build job built and tested. + publish: + needs: build + if: github.event_name == 'push' + permissions: + contents: write # the release for a tag + issues: write # as before the permissions moved here + packages: write # the canary packages + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + persist-credentials: false + + - run: | + git fetch --prune --unshallow --tags + echo exit code $? + git tag --list + + - uses: actions/setup-dotnet@v4 + with: + global-json-file: ./global.json + dotnet-version: | + 6.x + + - uses: actions/download-artifact@v4 + name: Take the packages the build job kept + with: + name: packages + path: build/output + - name: publish canary packages github package repository if: github.event_name == 'push' && startswith(github.ref, 'refs/heads') shell: bash