Skip to content

Commit

Permalink
Re-generate client code using latest OpenSearch API specification (20…
Browse files Browse the repository at this point in the history
…24-09-16)

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Xtansia authored and github-actions[bot] committed Sep 16, 2024
1 parent 69a1807 commit 6f0f452
Show file tree
Hide file tree
Showing 7 changed files with 3,590 additions and 828 deletions.
4,264 changes: 3,509 additions & 755 deletions src/ApiGenerator/opensearch-openapi.yaml

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/OpenSearch.Client/_Generated/Descriptors.Cat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public partial class CatAllPitSegmentsDescriptor
// values part of the url path
// Request parameters
/// <summary>The unit in which to display byte values.</summary>
public CatAllPitSegmentsDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes);
public CatAllPitSegmentsDescriptor Bytes(ByteUnit? bytes) => Qs("bytes", bytes);

/// <summary>A short version of the Accept header, e.g. json, yaml.</summary>
public CatAllPitSegmentsDescriptor Format(string format) => Qs("format", format);
Expand Down Expand Up @@ -171,7 +171,7 @@ public CatAllocationDescriptor NodeId(NodeIds nodeId) =>

// Request parameters
/// <summary>The unit used to display byte values.</summary>
public CatAllocationDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes);
public CatAllocationDescriptor Bytes(ByteUnit? bytes) => Qs("bytes", bytes);

/// <summary>Operation timeout for connection to cluster-manager node.</summary>
/// <remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
Expand Down Expand Up @@ -332,7 +332,7 @@ public CatFielddataDescriptor Fields<T>(params Expression<Func<T, object>>[] fie

// Request parameters
/// <summary>The unit used to display byte values.</summary>
public CatFielddataDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes);
public CatFielddataDescriptor Bytes(ByteUnit? bytes) => Qs("bytes", bytes);

/// <summary>A short version of the Accept header, e.g. json, yaml.</summary>
public CatFielddataDescriptor Format(string format) => Qs("format", format);
Expand Down Expand Up @@ -428,7 +428,7 @@ public CatIndicesDescriptor Index<TOther>()

// Request parameters
/// <summary>The unit used to display byte values.</summary>
public CatIndicesDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes);
public CatIndicesDescriptor Bytes(ByteUnit? bytes) => Qs("bytes", bytes);

/// <summary>Operation timeout for connection to cluster-manager node.</summary>
/// <remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
Expand Down Expand Up @@ -572,7 +572,7 @@ public partial class CatNodesDescriptor
// values part of the url path
// Request parameters
/// <summary>The unit used to display byte values.</summary>
public CatNodesDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes);
public CatNodesDescriptor Bytes(ByteUnit? bytes) => Qs("bytes", bytes);

/// <summary>Operation timeout for connection to cluster-manager node.</summary>
/// <remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
Expand Down Expand Up @@ -671,7 +671,7 @@ public partial class CatPitSegmentsDescriptor
// values part of the url path
// Request parameters
/// <summary>The unit in which to display byte values.</summary>
public CatPitSegmentsDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes);
public CatPitSegmentsDescriptor Bytes(ByteUnit? bytes) => Qs("bytes", bytes);

/// <summary>A short version of the Accept header, e.g. json, yaml.</summary>
public CatPitSegmentsDescriptor Format(string format) => Qs("format", format);
Expand Down Expand Up @@ -776,7 +776,7 @@ public CatRecoveryDescriptor ActiveOnly(bool? activeonly = true) =>
Qs("active_only", activeonly);

/// <summary>The unit used to display byte values.</summary>
public CatRecoveryDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes);
public CatRecoveryDescriptor Bytes(ByteUnit? bytes) => Qs("bytes", bytes);

/// <summary>If `true`, the response includes detailed information about shard recoveries.</summary>
public CatRecoveryDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed);
Expand Down Expand Up @@ -888,7 +888,7 @@ public CatSegmentReplicationDescriptor AllowNoIndices(bool? allownoindices = tru
Qs("allow_no_indices", allownoindices);

/// <summary>The unit in which to display byte values.</summary>
public CatSegmentReplicationDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes);
public CatSegmentReplicationDescriptor Bytes(ByteUnit? bytes) => Qs("bytes", bytes);

/// <summary>If `true`, the response only includes latest completed segment replication events.</summary>
public CatSegmentReplicationDescriptor CompletedOnly(bool? completedonly = true) =>
Expand Down Expand Up @@ -971,7 +971,7 @@ public CatSegmentsDescriptor Index<TOther>()

// Request parameters
/// <summary>The unit used to display byte values.</summary>
public CatSegmentsDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes);
public CatSegmentsDescriptor Bytes(ByteUnit? bytes) => Qs("bytes", bytes);

/// <summary>Operation timeout for connection to cluster-manager node.</summary>
/// <remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
Expand Down Expand Up @@ -1035,7 +1035,7 @@ public CatShardsDescriptor Index<TOther>()

// Request parameters
/// <summary>The unit used to display byte values.</summary>
public CatShardsDescriptor Bytes(Bytes? bytes) => Qs("bytes", bytes);
public CatShardsDescriptor Bytes(ByteUnit? bytes) => Qs("bytes", bytes);

/// <summary>Operation timeout for connection to cluster-manager node.</summary>
/// <remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
Expand Down
40 changes: 20 additions & 20 deletions src/OpenSearch.Client/_Generated/Requests.Cat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ public partial class CatAllPitSegmentsRequest

// Request parameters
/// <summary>The unit in which to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -233,9 +233,9 @@ public CatAllocationRequest(NodeIds nodeId)

// Request parameters
/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -483,9 +483,9 @@ public CatFielddataRequest(Fields fields)

// Request parameters
/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -635,9 +635,9 @@ public CatIndicesRequest(Indices index)

// Request parameters
/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -908,9 +908,9 @@ public partial class CatNodesRequest

// Request parameters
/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -1084,9 +1084,9 @@ public partial class CatPitSegmentsRequest

// Request parameters
/// <summary>The unit in which to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -1246,9 +1246,9 @@ public bool? ActiveOnly
}

/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -1427,9 +1427,9 @@ public bool? AllowNoIndices
}

/// <summary>The unit in which to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -1552,9 +1552,9 @@ public CatSegmentsRequest(Indices index)

// Request parameters
/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -1646,9 +1646,9 @@ public CatShardsRequest(Indices index)

// Request parameters
/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down
30 changes: 15 additions & 15 deletions src/OpenSearch.Net/_Generated/Api/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
namespace OpenSearch.Net
{
[StringEnum]
public enum Bytes
public enum ByteUnit
{
[EnumMember(Value = "b")]
B,
Expand Down Expand Up @@ -467,7 +467,7 @@ public static partial class KnownEnums
{
static partial void RegisterEnumStringResolvers()
{
AddEnumStringResolver<Bytes>(GetStringValue);
AddEnumStringResolver<ByteUnit>(GetStringValue);
AddEnumStringResolver<ClusterHealthLevel>(GetStringValue);
AddEnumStringResolver<ClusterStateMetric>(GetStringValue);
AddEnumStringResolver<ExpandWildcards>(GetStringValue);
Expand All @@ -484,22 +484,22 @@ static partial void RegisterEnumStringResolvers()
AddEnumStringResolver<WaitForEvents>(GetStringValue);
}

public static string GetStringValue(this Bytes enumValue) =>
public static string GetStringValue(this ByteUnit enumValue) =>
enumValue switch
{
Bytes.B => "b",
Bytes.G => "g",
Bytes.Gb => "gb",
Bytes.K => "k",
Bytes.Kb => "kb",
Bytes.M => "m",
Bytes.Mb => "mb",
Bytes.P => "p",
Bytes.Pb => "pb",
Bytes.T => "t",
Bytes.Tb => "tb",
ByteUnit.B => "b",
ByteUnit.G => "g",
ByteUnit.Gb => "gb",
ByteUnit.K => "k",
ByteUnit.Kb => "kb",
ByteUnit.M => "m",
ByteUnit.Mb => "mb",
ByteUnit.P => "p",
ByteUnit.Pb => "pb",
ByteUnit.T => "t",
ByteUnit.Tb => "tb",
_ => throw new ArgumentException(
$"'{enumValue.ToString()}' is not a valid value for enum 'Bytes'"
$"'{enumValue.ToString()}' is not a valid value for enum 'ByteUnit'"
),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ public partial class CatAllPitSegmentsRequestParameters
public override bool SupportsBody => false;

/// <summary>The unit in which to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -175,9 +175,9 @@ public partial class CatAllocationRequestParameters
public override bool SupportsBody => false;

/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -372,9 +372,9 @@ public partial class CatFielddataRequestParameters
public override bool SupportsBody => false;

/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -493,9 +493,9 @@ public partial class CatIndicesRequestParameters
public override bool SupportsBody => false;

/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -742,9 +742,9 @@ public partial class CatNodesRequestParameters : RequestParameters<CatNodesReque
public override bool SupportsBody => false;

/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -903,9 +903,9 @@ public partial class CatPitSegmentsRequestParameters
public override bool SupportsBody => true;

/// <summary>The unit in which to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -1036,9 +1036,9 @@ public bool? ActiveOnly
}

/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -1193,9 +1193,9 @@ public bool? AllowNoIndices
}

/// <summary>The unit in which to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -1303,9 +1303,9 @@ public partial class CatSegmentsRequestParameters
public override bool SupportsBody => false;

/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down Expand Up @@ -1374,9 +1374,9 @@ public partial class CatShardsRequestParameters : RequestParameters<CatShardsReq
public override bool SupportsBody => false;

/// <summary>The unit used to display byte values.</summary>
public Bytes? Bytes
public ByteUnit? Bytes
{
get => Q<Bytes?>("bytes");
get => Q<ByteUnit?>("bytes");
set => Q("bytes", value);
}

Expand Down
Loading

0 comments on commit 6f0f452

Please sign in to comment.