88 */
99package org .elasticsearch .datastreams .options .action ;
1010
11+ import org .elasticsearch .TransportVersions ;
1112import org .elasticsearch .action .ActionRequestValidationException ;
1213import org .elasticsearch .action .ActionResponse ;
1314import org .elasticsearch .action .ActionType ;
@@ -59,7 +60,6 @@ public static class Request extends LocalClusterStateRequest implements IndicesR
5960 IndicesOptions .GatekeeperOptions .builder ().allowAliasToMultipleIndices (false ).allowClosedIndices (true ).allowSelectors (false )
6061 )
6162 .build ();
62- private boolean includeDefaults = false ;
6363
6464 public Request (TimeValue masterNodeTimeout , String [] names ) {
6565 super (masterNodeTimeout );
@@ -69,7 +69,6 @@ public Request(TimeValue masterNodeTimeout, String[] names) {
6969 public Request (TimeValue masterNodeTimeout , String [] names , boolean includeDefaults ) {
7070 super (masterNodeTimeout );
7171 this .names = names ;
72- this .includeDefaults = includeDefaults ;
7372 }
7473
7574 public String [] getNames () {
@@ -95,22 +94,23 @@ public Request(StreamInput in) throws IOException {
9594 super (in );
9695 this .names = in .readOptionalStringArray ();
9796 this .indicesOptions = IndicesOptions .readIndicesOptions (in );
98- this .includeDefaults = in .readBoolean ();
97+ // This boolean was removed in 8.19
98+ if (in .getTransportVersion ().isPatchFrom (TransportVersions .DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19 ) == false ) {
99+ in .readBoolean ();
100+ }
99101 }
100102
101103 @ Override
102104 public boolean equals (Object o ) {
103105 if (this == o ) return true ;
104106 if (o == null || getClass () != o .getClass ()) return false ;
105107 Request request = (Request ) o ;
106- return Arrays .equals (names , request .names )
107- && indicesOptions .equals (request .indicesOptions )
108- && includeDefaults == request .includeDefaults ;
108+ return Arrays .equals (names , request .names ) && indicesOptions .equals (request .indicesOptions );
109109 }
110110
111111 @ Override
112112 public int hashCode () {
113- int result = Objects .hash (indicesOptions , includeDefaults );
113+ int result = Objects .hash (indicesOptions );
114114 result = 31 * result + Arrays .hashCode (names );
115115 return result ;
116116 }
@@ -125,10 +125,6 @@ public IndicesOptions indicesOptions() {
125125 return indicesOptions ;
126126 }
127127
128- public boolean includeDefaults () {
129- return includeDefaults ;
130- }
131-
132128 public Request indicesOptions (IndicesOptions indicesOptions ) {
133129 this .indicesOptions = indicesOptions ;
134130 return this ;
@@ -144,11 +140,6 @@ public IndicesRequest indices(String... indices) {
144140 this .names = indices ;
145141 return this ;
146142 }
147-
148- public Request includeDefaults (boolean includeDefaults ) {
149- this .includeDefaults = includeDefaults ;
150- return this ;
151- }
152143 }
153144
154145 public static class Response extends ActionResponse implements ChunkedToXContentObject {
0 commit comments