Skip to content

Commit ca2363c

Browse files
authored
Merge branch 'main' into feat/add-chopper-requester-package
2 parents e4db547 + 9330265 commit ca2363c

File tree

61 files changed

+250
-133
lines changed

Some content is hidden

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

61 files changed

+250
-133
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Models/Search/Log.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ public Log() { }
3333
/// <param name="ip">IP address of the client that performed the request. (required).</param>
3434
/// <param name="queryHeaders">Request headers (API keys are obfuscated). (required).</param>
3535
/// <param name="sha1">SHA1 signature of the log entry. (required).</param>
36-
/// <param name="nbApiCalls">Number of API requests. (required).</param>
3736
/// <param name="processingTimeMs">Processing time for the query in milliseconds. This doesn't include latency due to the network. (required).</param>
38-
public Log(string timestamp, string method, string answerCode, string queryBody, string answer, string url, string ip, string queryHeaders, string sha1, string nbApiCalls, string processingTimeMs)
37+
public Log(string timestamp, string method, string answerCode, string queryBody, string answer, string url, string ip, string queryHeaders, string sha1, string processingTimeMs)
3938
{
4039
Timestamp = timestamp ?? throw new ArgumentNullException(nameof(timestamp));
4140
Method = method ?? throw new ArgumentNullException(nameof(method));
@@ -46,7 +45,6 @@ public Log(string timestamp, string method, string answerCode, string queryBody,
4645
Ip = ip ?? throw new ArgumentNullException(nameof(ip));
4746
QueryHeaders = queryHeaders ?? throw new ArgumentNullException(nameof(queryHeaders));
4847
Sha1 = sha1 ?? throw new ArgumentNullException(nameof(sha1));
49-
NbApiCalls = nbApiCalls ?? throw new ArgumentNullException(nameof(nbApiCalls));
5048
ProcessingTimeMs = processingTimeMs ?? throw new ArgumentNullException(nameof(processingTimeMs));
5149
}
5250

clients/algoliasearch-client-dart/packages/client_search/lib/src/model/log.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class Log {
1919
required this.ip,
2020
required this.queryHeaders,
2121
required this.sha1,
22-
required this.nbApiCalls,
22+
this.nbApiCalls,
2323
required this.processingTimeMs,
2424
this.index,
2525
this.queryParams,
@@ -65,7 +65,7 @@ final class Log {
6565

6666
/// Number of API requests.
6767
@JsonKey(name: r'nb_api_calls')
68-
final String nbApiCalls;
68+
final String? nbApiCalls;
6969

7070
/// Processing time for the query in milliseconds. This doesn't include latency due to the network.
7171
@JsonKey(name: r'processing_time_ms')

clients/algoliasearch-client-dart/packages/client_search/lib/src/model/log.g.dart

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/algoliasearch-client-go/algolia/search/model_log.go

Lines changed: 26 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/Log.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public Log setNbApiCalls(String nbApiCalls) {
163163
}
164164

165165
/** Number of API requests. */
166-
@javax.annotation.Nonnull
166+
@javax.annotation.Nullable
167167
public String getNbApiCalls() {
168168
return nbApiCalls;
169169
}

clients/algoliasearch-client-javascript/packages/client-search/model/log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export type Log = {
5151
/**
5252
* Number of API requests.
5353
*/
54-
nb_api_calls: string;
54+
nb_api_calls?: string;
5555

5656
/**
5757
* Processing time for the query in milliseconds. This doesn\'t include latency due to the network.

clients/algoliasearch-client-javascript/scripts/publish.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async function publish(): Promise<void> {
1111

1212
// publish the prereleases private packages
1313
await execaCommand(
14-
`yarn lerna exec --scope '@algolia/client-composition' --no-bail -- npm_config_registry=https://registry.npmjs.org/ npm publish --access private --tag alpha`,
14+
`yarn lerna exec --scope '@algolia/client-composition' --no-bail -- npm_config_registry=https://registry.npmjs.org/ npm publish --access private --tag alpha --tag latest`,
1515
{
1616
shell: 'bash',
1717
},

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/Log.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import kotlinx.serialization.json.*
1616
* @param ip IP address of the client that performed the request.
1717
* @param queryHeaders Request headers (API keys are obfuscated).
1818
* @param sha1 SHA1 signature of the log entry.
19-
* @param nbApiCalls Number of API requests.
2019
* @param processingTimeMs Processing time for the query in milliseconds. This doesn't include latency due to the network.
20+
* @param nbApiCalls Number of API requests.
2121
* @param index Index targeted by the query.
2222
* @param queryParams Query parameters sent with the request.
2323
* @param queryNbHits Number of search results (hits) returned for the query.
@@ -53,12 +53,12 @@ public data class Log(
5353
/** SHA1 signature of the log entry. */
5454
@SerialName(value = "sha1") val sha1: String,
5555

56-
/** Number of API requests. */
57-
@SerialName(value = "nb_api_calls") val nbApiCalls: String,
58-
5956
/** Processing time for the query in milliseconds. This doesn't include latency due to the network. */
6057
@SerialName(value = "processing_time_ms") val processingTimeMs: String,
6158

59+
/** Number of API requests. */
60+
@SerialName(value = "nb_api_calls") val nbApiCalls: String? = null,
61+
6262
/** Index targeted by the query. */
6363
@SerialName(value = "index") val index: String? = null,
6464

clients/algoliasearch-client-php/lib/Model/Search/Log.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,6 @@ public function listInvalidProperties()
278278
if (!isset($this->container['sha1']) || null === $this->container['sha1']) {
279279
$invalidProperties[] = "'sha1' can't be null";
280280
}
281-
if (!isset($this->container['nbApiCalls']) || null === $this->container['nbApiCalls']) {
282-
$invalidProperties[] = "'nbApiCalls' can't be null";
283-
}
284281
if (!isset($this->container['processingTimeMs']) || null === $this->container['processingTimeMs']) {
285282
$invalidProperties[] = "'processingTimeMs' can't be null";
286283
}
@@ -518,7 +515,7 @@ public function setSha1($sha1)
518515
/**
519516
* Gets nbApiCalls.
520517
*
521-
* @return string
518+
* @return null|string
522519
*/
523520
public function getNbApiCalls()
524521
{
@@ -528,7 +525,7 @@ public function getNbApiCalls()
528525
/**
529526
* Sets nbApiCalls.
530527
*
531-
* @param string $nbApiCalls number of API requests
528+
* @param null|string $nbApiCalls number of API requests
532529
*
533530
* @return self
534531
*/

clients/algoliasearch-client-python/algoliasearch/abtesting/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ async def set_client_api_key(self, api_key: str) -> None:
132132
"""Sets a new API key to authenticate requests."""
133133
self._transporter.config.set_client_api_key(api_key)
134134

135+
async def add_user_agent(self, segment: str, version: Optional[str] = None) -> None:
136+
"""adds a segment to the default user agent, and update the headers sent with each requests as well"""
137+
self._transporter.config.add_user_agent(segment, version)
138+
135139
async def add_ab_tests_with_http_info(
136140
self,
137141
add_ab_tests_request: Union[AddABTestsRequest, dict[str, Any]],
@@ -977,6 +981,10 @@ def set_client_api_key(self, api_key: str) -> None:
977981
"""Sets a new API key to authenticate requests."""
978982
self._transporter.config.set_client_api_key(api_key)
979983

984+
def add_user_agent(self, segment: str, version: Optional[str] = None) -> None:
985+
"""adds a segment to the default user agent, and update the headers sent with each requests as well"""
986+
self._transporter.config.add_user_agent(segment, version)
987+
980988
def add_ab_tests_with_http_info(
981989
self,
982990
add_ab_tests_request: Union[AddABTestsRequest, dict[str, Any]],

0 commit comments

Comments
 (0)