Skip to content

Commit 46a61fb

Browse files
millotpFluf22
authored andcommitted
convert all to milliseconds
1 parent ca7e137 commit 46a61fb

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
@@ -81,8 +81,7 @@ public suspend fun SearchClient.waitForApiKey(
8181
* @param indexName The index in which to perform the request.
8282
* @param taskID The ID of the task to wait for.
8383
* @param timeout If specified, the method will throw a
84-
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value in milliseconds is
85-
* elapsed.
84+
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value is elapsed.
8685
* @param maxRetries maximum number of retry attempts.
8786
* @param requestOptions additional request configuration.
8887
*/
@@ -130,8 +129,7 @@ public suspend fun SearchClient.waitTask(
130129
*
131130
* @param taskID The ID of the task to wait for.
132131
* @param timeout If specified, the method will throw a
133-
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value in milliseconds is
134-
* elapsed.
132+
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value is elapsed.
135133
* @param maxRetries maximum number of retry attempts.
136134
* @param requestOptions additional request configuration.
137135
*/
@@ -178,8 +176,7 @@ public suspend fun SearchClient.waitAppTask(
178176
* @param apiKey Necessary to know if an `update` operation has been processed, compare fields of
179177
* the response with it.
180178
* @param timeout If specified, the method will throw a
181-
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value in milliseconds is
182-
* elapsed.
179+
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value is elapsed.
183180
* @param maxRetries Maximum number of retry attempts.
184181
* @param requestOptions Additional request configuration.
185182
*/
@@ -216,8 +213,7 @@ public suspend fun SearchClient.waitKeyUpdate(
216213
* Wait on an API key creation operation.
217214
*
218215
* @param timeout If specified, the method will throw a
219-
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value in milliseconds is
220-
* elapsed.
216+
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value is elapsed.
221217
* @param maxRetries Maximum number of retry attempts.
222218
* @param requestOptions Additional request configuration.
223219
*/
@@ -249,8 +245,7 @@ public suspend fun SearchClient.waitKeyCreation(
249245
*
250246
* @param maxRetries Maximum number of retry attempts.
251247
* @param timeout If specified, the method will throw a
252-
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value in milliseconds is
253-
* elapsed.
248+
* [kotlinx.coroutines.TimeoutCancellationException] after the timeout value is elapsed.
254249
* @param requestOptions Additional request configuration.
255250
*/
256251
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)