Skip to content

Commit d66186e

Browse files
committed
Use conditional namespaces/usings
1 parent 0c680af commit d66186e

File tree

268 files changed

+1434
-26
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

268 files changed

+1434
-26
lines changed

src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/GetAsyncSearchRequest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information.
44

5+
#if ELASTICSEARCH_SERVERLESS
6+
namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
7+
#else
58
namespace Elastic.Clients.Elasticsearch.AsyncSearch;
9+
#endif
610

711
public partial class GetAsyncSearchRequest
812
{

src/Elastic.Clients.Elasticsearch.Shared/Api/AsyncSearch/SubmitAsyncSearchRequest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6+
#if ELASTICSEARCH_SERVERLESS
7+
using Elastic.Clients.Elasticsearch.Serverless.QueryDsl;
8+
#else
69
using Elastic.Clients.Elasticsearch.QueryDsl;
10+
#endif
711

12+
#if ELASTICSEARCH_SERVERLESS
13+
namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
14+
#else
815
namespace Elastic.Clients.Elasticsearch.AsyncSearch;
16+
#endif
917

1018
public partial class SubmitAsyncSearchRequest
1119
{

src/Elastic.Clients.Elasticsearch.Shared/Api/BulkRequest.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,27 @@
88
using System.IO;
99
using System.Collections.Generic;
1010
using System.Linq;
11+
#if ELASTICSEARCH_SERVERLESS
12+
using Elastic.Clients.Elasticsearch.Serverless.Core.Bulk;
13+
#else
1114
using Elastic.Clients.Elasticsearch.Core.Bulk;
15+
#endif
16+
#if ELASTICSEARCH_SERVERLESS
17+
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
18+
#else
1219
using Elastic.Clients.Elasticsearch.Serialization;
20+
#endif
21+
#if ELASTICSEARCH_SERVERLESS
22+
using Elastic.Clients.Elasticsearch.Serverless.Requests;
23+
#else
1324
using Elastic.Clients.Elasticsearch.Requests;
25+
#endif
1426

27+
#if ELASTICSEARCH_SERVERLESS
28+
namespace Elastic.Clients.Elasticsearch.Serverless;
29+
#else
1530
namespace Elastic.Clients.Elasticsearch;
31+
#endif
1632

1733
public partial class BulkRequest : IStreamSerializable
1834
{

src/Elastic.Clients.Elasticsearch.Shared/Api/BulkResponse.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@
66
using System.Text.Json.Serialization;
77
using System.Text;
88
using System.Linq;
9+
#if ELASTICSEARCH_SERVERLESS
10+
using Elastic.Clients.Elasticsearch.Serverless.Core.Bulk;
11+
#else
912
using Elastic.Clients.Elasticsearch.Core.Bulk;
13+
#endif
1014

15+
#if ELASTICSEARCH_SERVERLESS
16+
namespace Elastic.Clients.Elasticsearch.Serverless;
17+
#else
1118
namespace Elastic.Clients.Elasticsearch;
19+
#endif
1220

1321
public partial class BulkResponse
1422
{

src/Elastic.Clients.Elasticsearch.Shared/Api/CountRequest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6+
#if ELASTICSEARCH_SERVERLESS
7+
using Elastic.Clients.Elasticsearch.Serverless.QueryDsl;
8+
#else
69
using Elastic.Clients.Elasticsearch.QueryDsl;
10+
#endif
711

12+
#if ELASTICSEARCH_SERVERLESS
13+
namespace Elastic.Clients.Elasticsearch.Serverless;
14+
#else
815
namespace Elastic.Clients.Elasticsearch;
16+
#endif
917

1018
public sealed partial class CountRequest<TDocument> : CountRequest
1119
{

src/Elastic.Clients.Elasticsearch.Shared/Api/CreateRequest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information.
44

5+
#if ELASTICSEARCH_SERVERLESS
6+
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
7+
#else
58
using Elastic.Clients.Elasticsearch.Serialization;
9+
#endif
610
using Elastic.Transport;
711
using System.Text.Json;
812

13+
#if ELASTICSEARCH_SERVERLESS
14+
namespace Elastic.Clients.Elasticsearch.Serverless;
15+
#else
916
namespace Elastic.Clients.Elasticsearch;
17+
#endif
1018

1119
public sealed partial class CreateRequest<TDocument> : ICustomJsonWriter
1220
{

src/Elastic.Clients.Elasticsearch.Shared/Api/DeleteRequest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information.
44

5+
#if ELASTICSEARCH_SERVERLESS
6+
namespace Elastic.Clients.Elasticsearch.Serverless;
7+
#else
58
namespace Elastic.Clients.Elasticsearch;
9+
#endif
610

711
public sealed partial class DeleteRequest<TDocument> : DeleteRequest
812
{

src/Elastic.Clients.Elasticsearch.Shared/Api/Eql/EqlGetResponse.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
using System.Collections.Generic;
66
using System.Text.Json.Serialization;
77

8+
#if ELASTICSEARCH_SERVERLESS
9+
namespace Elastic.Clients.Elasticsearch.Serverless.Eql;
10+
#else
811
namespace Elastic.Clients.Elasticsearch.Eql;
12+
#endif
913

1014
public partial class EqlGetResponse<TEvent>
1115
{

src/Elastic.Clients.Elasticsearch.Shared/Api/ExistsRequest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
using System.Linq;
88
using System.Text.Json.Serialization;
99

10+
#if ELASTICSEARCH_SERVERLESS
11+
namespace Elastic.Clients.Elasticsearch.Serverless;
12+
#else
1013
namespace Elastic.Clients.Elasticsearch;
14+
#endif
1115

1216
public partial class ExistsRequest
1317
{

src/Elastic.Clients.Elasticsearch.Shared/Api/GetSourceRequestDescriptor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information.
44

5+
#if ELASTICSEARCH_SERVERLESS
6+
namespace Elastic.Clients.Elasticsearch.Serverless;
7+
#else
58
namespace Elastic.Clients.Elasticsearch;
9+
#endif
610

711
public partial class GetSourceRequestDescriptor
812
{

src/Elastic.Clients.Elasticsearch.Shared/Api/GetSourceResponse.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
44

55
using System.Text.Json;
66
using System.IO;
7+
#if ELASTICSEARCH_SERVERLESS
8+
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
9+
#else
710
using Elastic.Clients.Elasticsearch.Serialization;
11+
#endif
812

13+
#if ELASTICSEARCH_SERVERLESS
14+
namespace Elastic.Clients.Elasticsearch.Serverless;
15+
#else
916
namespace Elastic.Clients.Elasticsearch;
17+
#endif
1018

1119
public partial class GetSourceResponse<TDocument> : ISelfDeserializable
1220
{

src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetAliasResponse.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
using System.Collections.Generic;
66
using System.Text.Json.Serialization;
77

8+
#if ELASTICSEARCH_SERVERLESS
9+
namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement;
10+
#else
811
namespace Elastic.Clients.Elasticsearch.IndexManagement;
12+
#endif
913

1014
public partial class GetAliasResponse
1115
{

src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetFieldMappingResponse.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@
66
using System.Collections.Generic;
77
using System.Linq.Expressions;
88
using System.Text.Json.Serialization;
9+
#if ELASTICSEARCH_SERVERLESS
10+
using Elastic.Clients.Elasticsearch.Serverless.Mapping;
11+
#else
912
using Elastic.Clients.Elasticsearch.Mapping;
13+
#endif
1014

15+
#if ELASTICSEARCH_SERVERLESS
16+
namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement;
17+
#else
1118
namespace Elastic.Clients.Elasticsearch.IndexManagement;
19+
#endif
1220

1321
public partial class GetFieldMappingResponse
1422
{

src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetIndexResponse.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
using System.Collections.Generic;
66
using System.Text.Json.Serialization;
77

8+
#if ELASTICSEARCH_SERVERLESS
9+
namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement;
10+
#else
811
namespace Elastic.Clients.Elasticsearch.IndexManagement;
12+
#endif
913

1014
public partial class GetIndexResponse
1115
{

src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetMappingResponse.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
44

55
using System.Collections.Generic;
66
using System.Text.Json.Serialization;
7+
#if ELASTICSEARCH_SERVERLESS
8+
using Elastic.Clients.Elasticsearch.Serverless.Mapping;
9+
#else
710
using Elastic.Clients.Elasticsearch.Mapping;
11+
#endif
812

13+
#if ELASTICSEARCH_SERVERLESS
14+
namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement;
15+
#else
916
namespace Elastic.Clients.Elasticsearch.IndexManagement;
17+
#endif
1018

1119
public partial class GetMappingResponse
1220
{

src/Elastic.Clients.Elasticsearch.Shared/Api/IndexManagement/GetTemplateResponse.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
using System.Collections.Generic;
66
using System.Text.Json.Serialization;
77

8+
#if ELASTICSEARCH_SERVERLESS
9+
namespace Elastic.Clients.Elasticsearch.Serverless.IndexManagement;
10+
#else
811
namespace Elastic.Clients.Elasticsearch.IndexManagement;
12+
#endif
913

1014
public partial class GetTemplateResponse
1115
{

src/Elastic.Clients.Elasticsearch.Shared/Api/IndexRequest.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,23 @@
44

55
using System.Text.Json;
66
using System.Text.Json.Serialization;
7+
#if ELASTICSEARCH_SERVERLESS
8+
using Elastic.Clients.Elasticsearch.Serverless.Requests;
9+
#else
710
using Elastic.Clients.Elasticsearch.Requests;
11+
#endif
12+
#if ELASTICSEARCH_SERVERLESS
13+
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
14+
#else
815
using Elastic.Clients.Elasticsearch.Serialization;
16+
#endif
917
using Elastic.Transport;
1018

19+
#if ELASTICSEARCH_SERVERLESS
20+
namespace Elastic.Clients.Elasticsearch.Serverless;
21+
#else
1122
namespace Elastic.Clients.Elasticsearch;
23+
#endif
1224

1325
public partial class IndexRequest<TDocument> : ICustomJsonWriter
1426
{

src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/GetPipelineResponse.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
using System.Collections.Generic;
66
using System.Text.Json.Serialization;
77

8+
#if ELASTICSEARCH_SERVERLESS
9+
namespace Elastic.Clients.Elasticsearch.Serverless.Ingest;
10+
#else
811
namespace Elastic.Clients.Elasticsearch.Ingest;
12+
#endif
913

1014
public partial class GetPipelineResponse
1115
{

src/Elastic.Clients.Elasticsearch.Shared/Api/Ingest/Processor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
using System.Diagnostics.CodeAnalysis;
66

7+
#if ELASTICSEARCH_SERVERLESS
8+
namespace Elastic.Clients.Elasticsearch.Serverless.Ingest;
9+
#else
710
namespace Elastic.Clients.Elasticsearch.Ingest;
11+
#endif
812

913
public partial class Processor
1014
{

src/Elastic.Clients.Elasticsearch.Shared/Api/MultiSearchRequest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
using System.Linq;
66
using System.Text.Json.Serialization;
77

8+
#if ELASTICSEARCH_SERVERLESS
9+
namespace Elastic.Clients.Elasticsearch.Serverless;
10+
#else
811
namespace Elastic.Clients.Elasticsearch;
12+
#endif
913

1014
public partial class MultiSearchResponse<TDocument>
1115
{

src/Elastic.Clients.Elasticsearch.Shared/Api/ResponseItem.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
using System;
66

7+
#if ELASTICSEARCH_SERVERLESS
8+
namespace Elastic.Clients.Elasticsearch.Serverless.Core.Bulk;
9+
#else
710
namespace Elastic.Clients.Elasticsearch.Core.Bulk;
11+
#endif
812

913
public abstract partial class ResponseItem
1014
{

src/Elastic.Clients.Elasticsearch.Shared/Api/ScrollResponse.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
using System.Linq;
77
using System.Text.Json.Serialization;
88

9+
#if ELASTICSEARCH_SERVERLESS
10+
namespace Elastic.Clients.Elasticsearch.Serverless;
11+
#else
912
namespace Elastic.Clients.Elasticsearch;
13+
#endif
1014

1115
public partial class ScrollResponse<TDocument>
1216
{

src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
44

55
using System;
66
using System.Collections.Generic;
7+
#if ELASTICSEARCH_SERVERLESS
8+
using Elastic.Clients.Elasticsearch.Serverless.Requests;
9+
#else
710
using Elastic.Clients.Elasticsearch.Requests;
11+
#endif
812

13+
#if ELASTICSEARCH_SERVERLESS
14+
namespace Elastic.Clients.Elasticsearch.Serverless;
15+
#else
916
namespace Elastic.Clients.Elasticsearch;
17+
#endif
1018

1119
public partial class SearchRequest
1220
{

src/Elastic.Clients.Elasticsearch.Shared/Api/SearchResponse.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
using System.Linq;
77
using System.Text.Json.Serialization;
88

9+
#if ELASTICSEARCH_SERVERLESS
10+
namespace Elastic.Clients.Elasticsearch.Serverless;
11+
#else
912
namespace Elastic.Clients.Elasticsearch;
13+
#endif
1014

1115
public partial class SearchResponse<TDocument>
1216
{
@@ -18,4 +22,4 @@ public partial class SearchResponse<TDocument>
1822

1923
[JsonIgnore]
2024
public long Total => HitsMetadata?.Total?.Value ?? -1;
21-
}
25+
}

src/Elastic.Clients.Elasticsearch.Shared/Api/Sql/GetAsyncResponse.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
using System.Collections.Generic;
66
using System.Text.Json.Serialization;
77

8+
#if ELASTICSEARCH_SERVERLESS
9+
namespace Elastic.Clients.Elasticsearch.Serverless.Sql;
10+
#else
811
namespace Elastic.Clients.Elasticsearch.Sql;
12+
#endif
913

1014
public partial class GetAsyncResponse
1115
{

src/Elastic.Clients.Elasticsearch.Shared/Api/Sql/QueryResponse.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
using System.Collections.Generic;
66
using System.Text.Json.Serialization;
77

8+
#if ELASTICSEARCH_SERVERLESS
9+
namespace Elastic.Clients.Elasticsearch.Serverless.Sql;
10+
#else
811
namespace Elastic.Clients.Elasticsearch.Sql;
12+
#endif
913

1014
public partial class QueryResponse
1115
{

0 commit comments

Comments
 (0)