src/Elastic.Clients.Elasticsearch/_Generated/Api/OpenPointInTimeResponse.g.cs (69 lines of code) (raw):

// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. // // ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ // ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ // ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ // ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ // ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ // ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ // ------------------------------------------------ // // This file is automatically generated. // Please do not edit these files manually. // // ------------------------------------------------ #nullable restore using System; using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; namespace Elastic.Clients.Elasticsearch; internal sealed partial class OpenPointInTimeResponseConverter : System.Text.Json.Serialization.JsonConverter<Elastic.Clients.Elasticsearch.OpenPointInTimeResponse> { private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards"); public override Elastic.Clients.Elasticsearch.OpenPointInTimeResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue<string> propId = default; LocalJsonValue<Elastic.Clients.Elasticsearch.ShardStatistics> propShards = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propId.TryReadProperty(ref reader, options, PropId, null)) { continue; } if (propShards.TryReadProperty(ref reader, options, PropShards, null)) { continue; } if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.Skip(); continue; } throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.OpenPointInTimeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Id = propId.Value, Shards = propShards.Value }; } public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.OpenPointInTimeResponse value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteProperty(options, PropId, value.Id, null, null); writer.WriteProperty(options, PropShards, value.Shards, null, null); writer.WriteEndObject(); } } [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.OpenPointInTimeResponseConverter))] public sealed partial class OpenPointInTimeResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public OpenPointInTimeResponse() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] internal OpenPointInTimeResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } public #if NET7_0_OR_GREATER required #endif string Id { get; set; } /// <summary> /// <para> /// Shards used to create the PIT /// </para> /// </summary> public #if NET7_0_OR_GREATER required #endif Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; } }