@@ -10,68 +10,68 @@ namespace ksqlDB.RestApi.Client.KSql.RestApi.Extensions;
10
10
11
11
public static class HttpResponseMessageExtensions
12
12
{
13
- public static StatementResponse [ ] ToStatementResponses ( this HttpResponseMessage httpResponseMessage , CancellationToken cancellationToken = default )
13
+ public static StatementResponse [ ] ToStatementResponses ( this HttpResponseMessage httpResponseMessage )
14
14
{
15
- string responseContent = httpResponseMessage . Content . ReadAsStringAsync ( cancellationToken ) . Result ;
16
-
15
+ string responseContent = httpResponseMessage . Content . ReadAsStringAsync ( ) . Result ;
16
+
17
17
var responseObjects = JsonSerializer . Deserialize < StatementResponse [ ] > ( responseContent ) ;
18
18
19
19
return responseObjects ?? [ ] ;
20
20
}
21
21
22
- public static StatementResponse ? ToStatementResponse ( this HttpResponseMessage httpResponseMessage , CancellationToken cancellationToken = default )
22
+ public static StatementResponse ? ToStatementResponse ( this HttpResponseMessage httpResponseMessage )
23
23
{
24
- string responseContent = httpResponseMessage . Content . ReadAsStringAsync ( cancellationToken ) . Result ;
25
-
24
+ string responseContent = httpResponseMessage . Content . ReadAsStringAsync ( ) . Result ;
25
+
26
26
var responseObject = JsonSerializer . Deserialize < StatementResponse > ( responseContent ) ;
27
27
28
28
return responseObject ;
29
29
}
30
30
31
- public static Task < StatementResponse [ ] > ToStatementResponsesAsync ( this HttpResponseMessage httpResponseMessage , CancellationToken cancellationToken = default )
31
+ public static Task < StatementResponse [ ] > ToStatementResponsesAsync ( this HttpResponseMessage httpResponseMessage )
32
32
{
33
- return httpResponseMessage . ToStatementResponsesAsync < StatementResponse > ( cancellationToken ) ;
33
+ return httpResponseMessage . ToStatementResponsesAsync < StatementResponse > ( ) ;
34
34
}
35
35
36
- public static Task < StreamsResponse [ ] > ToStreamsResponseAsync ( this HttpResponseMessage httpResponseMessage , CancellationToken cancellationToken = default )
36
+ public static Task < StreamsResponse [ ] > ToStreamsResponseAsync ( this HttpResponseMessage httpResponseMessage )
37
37
{
38
- return httpResponseMessage . ToStatementResponsesAsync < StreamsResponse > ( cancellationToken ) ;
38
+ return httpResponseMessage . ToStatementResponsesAsync < StreamsResponse > ( ) ;
39
39
}
40
40
41
- public static Task < TablesResponse [ ] > ToTablesResponseAsync ( this HttpResponseMessage httpResponseMessage , CancellationToken cancellationToken = default )
41
+ public static Task < TablesResponse [ ] > ToTablesResponseAsync ( this HttpResponseMessage httpResponseMessage )
42
42
{
43
- return httpResponseMessage . ToStatementResponsesAsync < TablesResponse > ( cancellationToken ) ;
43
+ return httpResponseMessage . ToStatementResponsesAsync < TablesResponse > ( ) ;
44
44
}
45
45
46
- public static Task < QueriesResponse [ ] > ToQueriesResponseAsync ( this HttpResponseMessage httpResponseMessage , CancellationToken cancellationToken = default )
46
+ public static Task < QueriesResponse [ ] > ToQueriesResponseAsync ( this HttpResponseMessage httpResponseMessage )
47
47
{
48
- return httpResponseMessage . ToStatementResponsesAsync < QueriesResponse > ( cancellationToken ) ;
48
+ return httpResponseMessage . ToStatementResponsesAsync < QueriesResponse > ( ) ;
49
49
}
50
50
51
- public static Task < TopicsResponse [ ] > ToTopicsResponseAsync ( this HttpResponseMessage httpResponseMessage , CancellationToken cancellationToken = default )
51
+ public static Task < TopicsResponse [ ] > ToTopicsResponseAsync ( this HttpResponseMessage httpResponseMessage )
52
52
{
53
- return httpResponseMessage . ToStatementResponsesAsync < TopicsResponse > ( cancellationToken ) ;
53
+ return httpResponseMessage . ToStatementResponsesAsync < TopicsResponse > ( ) ;
54
54
}
55
-
56
- public static Task < TopicsExtendedResponse [ ] > ToTopicsExtendedResponseAsync ( this HttpResponseMessage httpResponseMessage , CancellationToken cancellationToken = default )
55
+
56
+ public static Task < TopicsExtendedResponse [ ] > ToTopicsExtendedResponseAsync ( this HttpResponseMessage httpResponseMessage )
57
57
{
58
- return httpResponseMessage . ToStatementResponsesAsync < TopicsExtendedResponse > ( cancellationToken ) ;
58
+ return httpResponseMessage . ToStatementResponsesAsync < TopicsExtendedResponse > ( ) ;
59
59
}
60
60
61
- public static Task < ConnectorsResponse [ ] > ToConnectorsResponseAsync ( this HttpResponseMessage httpResponseMessage , CancellationToken cancellationToken = default )
61
+ public static Task < ConnectorsResponse [ ] > ToConnectorsResponseAsync ( this HttpResponseMessage httpResponseMessage )
62
62
{
63
- return httpResponseMessage . ToStatementResponsesAsync < ConnectorsResponse > ( cancellationToken ) ;
63
+ return httpResponseMessage . ToStatementResponsesAsync < ConnectorsResponse > ( ) ;
64
64
}
65
65
66
- internal static async Task < TResponse [ ] > ToStatementResponsesAsync < TResponse > ( this HttpResponseMessage httpResponseMessage , CancellationToken cancellationToken = default )
66
+ internal static async Task < TResponse [ ] > ToStatementResponsesAsync < TResponse > ( this HttpResponseMessage httpResponseMessage )
67
67
{
68
68
TResponse [ ] ? statementResponses ;
69
69
70
70
if ( httpResponseMessage . IsSuccessStatusCode )
71
- statementResponses = await httpResponseMessage . ToStatementResponseAsync < TResponse [ ] > ( cancellationToken ) . ConfigureAwait ( false ) ;
71
+ statementResponses = await httpResponseMessage . ToStatementResponseAsync < TResponse [ ] > ( ) . ConfigureAwait ( false ) ;
72
72
else
73
73
{
74
- var statementResponse = await httpResponseMessage . ToStatementResponseAsync < TResponse > ( cancellationToken ) . ConfigureAwait ( false ) ;
74
+ var statementResponse = await httpResponseMessage . ToStatementResponseAsync < TResponse > ( ) . ConfigureAwait ( false ) ;
75
75
statementResponses = statementResponse != null ? [ statementResponse ] : [ ] ;
76
76
}
77
77
@@ -82,11 +82,11 @@ internal static async Task<TResponse[]> ToStatementResponsesAsync<TResponse>(thi
82
82
{
83
83
PropertyNameCaseInsensitive = true
84
84
} ;
85
-
86
- private static async Task < TResponse ? > ToStatementResponseAsync < TResponse > ( this HttpResponseMessage httpResponseMessage , CancellationToken cancellationToken = default )
85
+
86
+ private static async Task < TResponse ? > ToStatementResponseAsync < TResponse > ( this HttpResponseMessage httpResponseMessage )
87
87
{
88
- string responseContent = await httpResponseMessage . Content . ReadAsStringAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
89
-
88
+ string responseContent = await httpResponseMessage . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
89
+
90
90
var responseObject = JsonSerializer . Deserialize < TResponse > ( responseContent , JsonSerializerOptions ) ;
91
91
92
92
return responseObject ;
0 commit comments