Skip to content

Commit 9330265

Browse files
fix(specs): nb_api_calls in getLogs response is optional (#4142) (generated) [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 9e02356 commit 9330265

File tree

14 files changed

+45
-41
lines changed
  • clients
    • algoliasearch-client-csharp/algoliasearch/Models/Search
    • algoliasearch-client-dart/packages/client_search/lib/src/model
    • algoliasearch-client-go/algolia/search
    • algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search
    • algoliasearch-client-javascript/packages/client-search/model
    • algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search
    • algoliasearch-client-php/lib/Model/Search
    • algoliasearch-client-python/algoliasearch/search/models
    • algoliasearch-client-ruby/lib/algolia/models/search
    • algoliasearch-client-scala/src/main/scala/algoliasearch/search
    • algoliasearch-client-swift/Sources/Search/Models
  • specs/bundled

14 files changed

+45
-41
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-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/search/models/log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Log(BaseModel):
6666
""" Request headers (API keys are obfuscated). """
6767
sha1: str
6868
""" SHA1 signature of the log entry. """
69-
nb_api_calls: str
69+
nb_api_calls: Optional[str] = None
7070
""" Number of API requests. """
7171
processing_time_ms: str
7272
""" Processing time for the query in milliseconds. This doesn't include latency due to the network. """

clients/algoliasearch-client-ruby/lib/algolia/models/search/log.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ def initialize(attributes = {})
181181

182182
if attributes.key?(:nb_api_calls)
183183
self.nb_api_calls = attributes[:nb_api_calls]
184-
else
185-
self.nb_api_calls = nil
186184
end
187185

188186
if attributes.key?(:processing_time_ms)

clients/algoliasearch-client-scala/src/main/scala/algoliasearch/search/Log.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ case class Log(
7878
ip: String,
7979
queryHeaders: String,
8080
sha1: String,
81-
nbApiCalls: String,
81+
nbApiCalls: Option[String] = scala.None,
8282
processingTimeMs: String,
8383
index: Option[String] = scala.None,
8484
queryParams: Option[String] = scala.None,

clients/algoliasearch-client-swift/Sources/Search/Models/Log.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public struct Log: Codable, JSONEncodable {
2626
/// SHA1 signature of the log entry.
2727
public var sha1: String
2828
/// Number of API requests.
29-
public var nbApiCalls: String
29+
public var nbApiCalls: String?
3030
/// Processing time for the query in milliseconds. This doesn't include latency due to the network.
3131
public var processingTimeMs: String
3232
/// Index targeted by the query.
@@ -48,7 +48,7 @@ public struct Log: Codable, JSONEncodable {
4848
ip: String,
4949
queryHeaders: String,
5050
sha1: String,
51-
nbApiCalls: String,
51+
nbApiCalls: String? = nil,
5252
processingTimeMs: String,
5353
index: String? = nil,
5454
queryParams: String? = nil,
@@ -103,7 +103,7 @@ public struct Log: Codable, JSONEncodable {
103103
try container.encode(self.ip, forKey: .ip)
104104
try container.encode(self.queryHeaders, forKey: .queryHeaders)
105105
try container.encode(self.sha1, forKey: .sha1)
106-
try container.encode(self.nbApiCalls, forKey: .nbApiCalls)
106+
try container.encodeIfPresent(self.nbApiCalls, forKey: .nbApiCalls)
107107
try container.encode(self.processingTimeMs, forKey: .processingTimeMs)
108108
try container.encodeIfPresent(self.index, forKey: .index)
109109
try container.encodeIfPresent(self.queryParams, forKey: .queryParams)
@@ -143,7 +143,7 @@ extension Log: Hashable {
143143
hasher.combine(self.ip.hashValue)
144144
hasher.combine(self.queryHeaders.hashValue)
145145
hasher.combine(self.sha1.hashValue)
146-
hasher.combine(self.nbApiCalls.hashValue)
146+
hasher.combine(self.nbApiCalls?.hashValue)
147147
hasher.combine(self.processingTimeMs.hashValue)
148148
hasher.combine(self.index?.hashValue)
149149
hasher.combine(self.queryParams?.hashValue)

specs/bundled/search.doc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15341,7 +15341,6 @@ paths:
1534115341
- ip
1534215342
- query_headers
1534315343
- sha1
15344-
- nb_api_calls
1534515344
- processing_time_ms
1534615345
'400':
1534715346
$ref: '#/components/responses/BadRequest'

specs/bundled/search.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2989,7 +2989,6 @@ paths:
29892989
- ip
29902990
- query_headers
29912991
- sha1
2992-
- nb_api_calls
29932992
- processing_time_ms
29942993
'400':
29952994
$ref: '#/components/responses/BadRequest'

0 commit comments

Comments
 (0)