Skip to content

Commit e2db756

Browse files
committed
convert all to milliseconds
1 parent 4c73157 commit e2db756

File tree

18 files changed

+39
-79
lines changed

18 files changed

+39
-79
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Http/InternalRequestOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ public void AddCustomQueryParameters(IDictionary<string, object> values)
7878
public object Data { get; set; }
7979

8080
/// <summary>
81-
/// Request read timeout in seconds
81+
/// Request read timeout
8282
/// </summary>
8383
public TimeSpan? ReadTimeout { get; set; }
8484

8585
/// <summary>
86-
/// Request write timeout in seconds
86+
/// Request write timeout
8787
/// </summary>
8888
public TimeSpan? WriteTimeout { get; set; }
8989

9090
/// <summary>
91-
/// Request connect timeout in seconds
91+
/// Request connect timeout
9292
/// </summary>
9393
public TimeSpan? ConnectTimeout { get; set; }
9494

clients/algoliasearch-client-csharp/algoliasearch/Http/RequestOptions.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ public class RequestOptions
2020
public IDictionary<string, object> QueryParameters { get; set; }
2121

2222
/// <summary>
23-
/// Request timeout in seconds
23+
/// Request timeout
2424
/// </summary>
2525
public TimeSpan? ReadTimeout { get; set; }
2626

2727
/// <summary>
28-
/// Request timeout in seconds
28+
/// Request timeout
2929
/// </summary>
3030
public TimeSpan? WriteTimeout { get; set; }
3131

3232
/// <summary>
33-
/// Request timeout in seconds
33+
/// Request timeout
3434
/// </summary>
3535
public TimeSpan? ConnectTimeout { get; set; }
3636

@@ -42,7 +42,4 @@ public RequestOptions()
4242
QueryParameters = new Dictionary<string, object>();
4343
Headers = new Dictionary<string, string>();
4444
}
45-
46-
// overload + operator
47-
4845
}

clients/algoliasearch-client-dart/packages/client_core/lib/src/transport/request_options.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/// Represents options for configuring a request to an endpoint.
22
final class RequestOptions {
3-
/// The write timeout for the request in milliseconds.
3+
/// The write timeout for the request.
44
final Duration? writeTimeout;
55

6-
/// The read timeout for the request in milliseconds.
6+
/// The read timeout for the request.
77
final Duration? readTimeout;
88

9-
/// The connect timeout for the request in milliseconds.
9+
/// The connect timeout for the request.
1010
final Duration? connectTimeout;
1111

1212
/// Header names to their respective values to be sent with the request.

clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import java.util.concurrent.ExecutorService;
1818
import java.util.stream.Collectors;
1919
import javax.annotation.Nonnull;
20-
import org.jetbrains.annotations.Nullable;
20+
import javax.annotation.Nullable;
2121

2222
/**
2323
* Represents a base client for making API requests. The client uses a {@link Requester} for

clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/config/RequestOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import java.time.Duration;
55
import java.util.HashMap;
66
import java.util.Map;
7-
import org.jetbrains.annotations.Nullable;
7+
import javax.annotation.Nullable;
88

99
/**
1010
* Request options are used to pass extra parameters, headers, timeout to the request. Parameters

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/extensions/SearchClient.kt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ public suspend fun SearchClient.waitForApiKey(
8383
* @param indexName The index in which to perform the request.
8484
* @param taskID The ID of the task to wait for.
8585
* @param timeout If specified, the method will throw a
86-
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value in milliseconds is
87-
* elapsed.
86+
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value is elapsed.
8887
* @param maxRetries maximum number of retry attempts.
8988
* @param requestOptions additional request configuration.
9089
*/
@@ -136,8 +135,7 @@ public suspend fun SearchClient.waitTask(
136135
*
137136
* @param taskID The ID of the task to wait for.
138137
* @param timeout If specified, the method will throw a
139-
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value in milliseconds is
140-
* elapsed.
138+
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value is elapsed.
141139
* @param maxRetries maximum number of retry attempts.
142140
* @param requestOptions additional request configuration.
143141
*/
@@ -188,8 +186,7 @@ public suspend fun SearchClient.waitAppTask(
188186
* @param apiKey Necessary to know if an `update` operation has been processed, compare fields of
189187
* the response with it.
190188
* @param timeout If specified, the method will throw a
191-
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value in milliseconds is
192-
* elapsed.
189+
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value is elapsed.
193190
* @param maxRetries Maximum number of retry attempts.
194191
* @param requestOptions Additional request configuration.
195192
*/
@@ -228,8 +225,7 @@ public suspend fun SearchClient.waitKeyUpdate(
228225
* Wait on an API key creation operation.
229226
*
230227
* @param timeout If specified, the method will throw a
231-
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value in milliseconds is
232-
* elapsed.
228+
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value is elapsed.
233229
* @param maxRetries Maximum number of retry attempts.
234230
* @param requestOptions Additional request configuration.
235231
*/
@@ -263,8 +259,7 @@ public suspend fun SearchClient.waitKeyCreation(
263259
*
264260
* @param maxRetries Maximum number of retry attempts.
265261
* @param timeout If specified, the method will throw a
266-
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value in milliseconds is
267-
* elapsed.
262+
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value is elapsed.
268263
* @param requestOptions Additional request configuration.
269264
*/
270265
public suspend fun SearchClient.waitKeyDelete(

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/transport/RequestOptions.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import kotlin.time.Duration
66
/**
77
* Represents options for configuring a request to an endpoint.
88
*
9-
* @property writeTimeout The write timeout for the request in milliseconds.
10-
* @property readTimeout The read timeout for the request in milliseconds.
11-
* @property connectTimeout The connect timeout for the request in milliseconds.
9+
* @property writeTimeout The write timeout for the request.
10+
* @property readTimeout The read timeout for the request.
11+
* @property connectTimeout The connect timeout for the request.
1212
* @property headers A mutable map of header names to their respective values to be sent with the request.
1313
* @property urlParameters A mutable map of URL parameter names to their respective values to be appended to the request URL.
1414
* @property body A JSON object representing the request body.

generators/src/main/java/com/algolia/codegen/AlgoliaDartGenerator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import static org.apache.commons.lang3.StringUtils.*;
44

5-
import com.algolia.codegen.lambda.ToSecondsLambda;
65
import com.algolia.codegen.utils.*;
76
import com.google.common.collect.ImmutableMap;
87
import com.samskivert.mustache.Mustache;
@@ -114,7 +113,7 @@ public void processOpts() {
114113

115114
@Override
116115
protected ImmutableMap.Builder<String, Mustache.Lambda> addMustacheLambdas() {
117-
return super.addMustacheLambdas().put("toSeconds", new ToSecondsLambda());
116+
return super.addMustacheLambdas();
118117
}
119118

120119
@Override

generators/src/main/java/com/algolia/codegen/AlgoliaGoGenerator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.algolia.codegen.exceptions.*;
44
import com.algolia.codegen.lambda.ScreamingSnakeCaseLambda;
5-
import com.algolia.codegen.lambda.ToSecondsLambda;
65
import com.algolia.codegen.utils.*;
76
import com.google.common.collect.ImmutableMap;
87
import com.google.common.collect.Iterables;
@@ -70,7 +69,6 @@ protected ImmutableMap.Builder<String, Mustache.Lambda> addMustacheLambdas() {
7069
ImmutableMap.Builder<String, Mustache.Lambda> lambdas = super.addMustacheLambdas();
7170

7271
lambdas.put("screamingSnakeCase", new ScreamingSnakeCaseLambda());
73-
lambdas.put("toSeconds", new ToSecondsLambda());
7472

7573
return lambdas;
7674
}

generators/src/main/java/com/algolia/codegen/AlgoliaPhpGenerator.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
import com.algolia.codegen.utils.*;
66
import com.google.common.collect.ImmutableMap;
77
import com.samskivert.mustache.Mustache;
8-
import com.samskivert.mustache.Mustache.Lambda;
98
import io.swagger.v3.oas.models.OpenAPI;
109
import io.swagger.v3.oas.models.Operation;
1110
import io.swagger.v3.oas.models.servers.Server;
12-
import java.time.temporal.ChronoUnit;
1311
import java.util.*;
1412
import org.openapitools.codegen.CodegenOperation;
1513
import org.openapitools.codegen.SupportingFile;
@@ -71,18 +69,14 @@ public void processOpts() {
7169

7270
@Override
7371
protected ImmutableMap.Builder<String, Mustache.Lambda> addMustacheLambdas() {
74-
ImmutableMap.Builder<String, Lambda> lambdas = super.addMustacheLambdas();
75-
76-
lambdas.put("toSeconds", new ToSecondsLambda());
77-
78-
return lambdas;
72+
return super.addMustacheLambdas().put("toSeconds", new ToSecondsLambda());
7973
}
8074

8175
@Override
8276
public void processOpenAPI(OpenAPI openAPI) {
8377
super.processOpenAPI(openAPI);
8478
Helpers.generateServers(super.fromServers(openAPI.getServers()), additionalProperties);
85-
Timeouts.enrichBundle(openAPI, additionalProperties, ChronoUnit.SECONDS);
79+
Timeouts.enrichBundle(openAPI, additionalProperties);
8680
}
8781

8882
@Override

0 commit comments

Comments
 (0)