Skip to content

Commit 45f6140

Browse files
authored
1 parent 6a4ad4d commit 45f6140

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

src/Nest/Modules/SnapshotAndRestore/Snapshot/GetSapshot/GetSnapshotRequest.cs renamed to src/Nest/Modules/SnapshotAndRestore/Snapshot/GetSnapshot/GetSnapshotRequest.cs

File renamed without changes.

src/Nest/Modules/SnapshotAndRestore/Snapshot/GetSapshot/GetSnapshotResponse.cs renamed to src/Nest/Modules/SnapshotAndRestore/Snapshot/GetSnapshot/GetSnapshotResponse.cs

File renamed without changes.

src/Nest/Modules/SnapshotAndRestore/Snapshot/Snapshot.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Runtime.Serialization;
4+
using Elasticsearch.Net;
45

56
namespace Nest
67
{
@@ -35,5 +36,8 @@ public class Snapshot
3536

3637
[DataMember(Name ="state")]
3738
public string State { get; internal set; }
39+
40+
[DataMember(Name ="metadata")]
41+
public IReadOnlyDictionary<string, object> Metadata { get; internal set; } = EmptyReadOnly<string, object>.Dictionary;
3842
}
3943
}

src/Nest/Modules/SnapshotAndRestore/Snapshot/Snapshot/SnapshotRequest.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using System.Runtime.Serialization;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Runtime.Serialization;
24
using Elasticsearch.Net.Utf8Json;
35

46
namespace Nest
@@ -18,6 +20,9 @@ public partial interface ISnapshotRequest
1820

1921
[DataMember(Name ="partial")]
2022
bool? Partial { get; set; }
23+
24+
[DataMember(Name = "metadata")]
25+
IDictionary<string, object> Metadata { get; set; }
2126
}
2227

2328
public partial class SnapshotRequest
@@ -28,6 +33,8 @@ public partial class SnapshotRequest
2833
public Indices Indices { get; set; }
2934

3035
public bool? Partial { get; set; }
36+
37+
public IDictionary<string, object> Metadata { get; set; }
3138
}
3239

3340
public partial class SnapshotDescriptor
@@ -39,6 +46,8 @@ public partial class SnapshotDescriptor
3946

4047
bool? ISnapshotRequest.Partial { get; set; }
4148

49+
IDictionary<string, object> ISnapshotRequest.Metadata { get; set; }
50+
4251
public SnapshotDescriptor Index(IndexName index) => Indices(index);
4352

4453
public SnapshotDescriptor Index<T>() where T : class => Indices(typeof(T));
@@ -50,5 +59,10 @@ public partial class SnapshotDescriptor
5059
public SnapshotDescriptor IncludeGlobalState(bool? includeGlobalState = true) => Assign(includeGlobalState, (a, v) => a.IncludeGlobalState = v);
5160

5261
public SnapshotDescriptor Partial(bool? partial = true) => Assign(partial, (a, v) => a.Partial = v);
62+
63+
public SnapshotDescriptor Metadata(IDictionary<string, object> metadata) => Assign(metadata, (a, v) => a.Metadata = v);
64+
65+
public SnapshotDescriptor Metadata(Func<FluentDictionary<string, object>, IDictionary<string, object>> selector) =>
66+
Assign(selector, (a, v) => a.Metadata = v?.Invoke(new FluentDictionary<string, object>()));
5367
}
5468
}

0 commit comments

Comments
 (0)