Skip to content

Commit 54e0508

Browse files
chore: revert swiftformat (#4878) (generated) [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 1c947a9 commit 54e0508

28 files changed

+351
-219
lines changed

clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClientConfiguration.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ public struct AbtestingClientConfiguration: BaseConfiguration, Credentials {
6060
}
6161

6262
if let region {
63-
guard let url = URL(string: "https://analytics.{region}.algolia.com"
64-
.replacingOccurrences(of: "{region}", with: region.rawValue)
63+
guard let url = URL(
64+
string: "https://analytics.{region}.algolia.com"
65+
.replacingOccurrences(of: "{region}", with: region.rawValue)
6566
) else {
6667
throw AlgoliaError.runtimeError("Malformed URL")
6768
}

clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClientConfiguration.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ public struct AnalyticsClientConfiguration: BaseConfiguration, Credentials {
6060
}
6161

6262
if let region {
63-
guard let url = URL(string: "https://analytics.{region}.algolia.com"
64-
.replacingOccurrences(of: "{region}", with: region.rawValue)
63+
guard let url = URL(
64+
string: "https://analytics.{region}.algolia.com"
65+
.replacingOccurrences(of: "{region}", with: region.rawValue)
6566
) else {
6667
throw AlgoliaError.runtimeError("Malformed URL")
6768
}

clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClientConfiguration.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ public struct IngestionClientConfiguration: BaseConfiguration, Credentials {
5959
)
6060
}
6161

62-
guard let url = URL(string: "https://data.{region}.algolia.com"
63-
.replacingOccurrences(of: "{region}", with: region.rawValue)
62+
guard let url = URL(
63+
string: "https://data.{region}.algolia.com"
64+
.replacingOccurrences(of: "{region}", with: region.rawValue)
6465
) else {
6566
throw AlgoliaError.runtimeError("Malformed URL")
6667
}

clients/algoliasearch-client-swift/Sources/Insights/InsightsClientConfiguration.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ public struct InsightsClientConfiguration: BaseConfiguration, Credentials {
6060
}
6161

6262
if let region {
63-
guard let url = URL(string: "https://insights.{region}.algolia.io"
64-
.replacingOccurrences(of: "{region}", with: region.rawValue)
63+
guard let url = URL(
64+
string: "https://insights.{region}.algolia.io"
65+
.replacingOccurrences(of: "{region}", with: region.rawValue)
6566
) else {
6667
throw AlgoliaError.runtimeError("Malformed URL")
6768
}

clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClient.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,9 @@ open class PersonalizationClient {
388388
// - recommendation
389389
// - returns: RequestBuilder<PersonalizationStrategyParams>
390390

391-
open func getPersonalizationStrategyWithHTTPInfo(requestOptions userRequestOptions: RequestOptions? =
392-
nil
391+
open func getPersonalizationStrategyWithHTTPInfo(
392+
requestOptions userRequestOptions: RequestOptions? =
393+
nil
393394
) async throws -> Response<PersonalizationStrategyParams> {
394395
let resourcePath = "/1/strategies/personalization"
395396
let body: AnyCodable? = nil

clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClientConfiguration.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ public struct PersonalizationClientConfiguration: BaseConfiguration, Credentials
5959
)
6060
}
6161

62-
guard let url = URL(string: "https://personalization.{region}.algolia.com"
63-
.replacingOccurrences(of: "{region}", with: region.rawValue)
62+
guard let url = URL(
63+
string: "https://personalization.{region}.algolia.com"
64+
.replacingOccurrences(of: "{region}", with: region.rawValue)
6465
) else {
6566
throw AlgoliaError.runtimeError("Malformed URL")
6667
}

clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClientConfiguration.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ public struct QuerySuggestionsClientConfiguration: BaseConfiguration, Credential
5959
)
6060
}
6161

62-
guard let url = URL(string: "https://query-suggestions.{region}.algolia.com"
63-
.replacingOccurrences(of: "{region}", with: region.rawValue)
62+
guard let url = URL(
63+
string: "https://query-suggestions.{region}.algolia.com"
64+
.replacingOccurrences(of: "{region}", with: region.rawValue)
6465
) else {
6566
throw AlgoliaError.runtimeError("Malformed URL")
6667
}

docs/bundled/search-snippets.json

Lines changed: 14 additions & 14 deletions
Large diffs are not rendered by default.

docs/snippets/swift/Sources/Search.swift

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,7 +2120,8 @@ final class SearchClientSnippet {
21202120
rule: Rule(
21212121
objectID: "clearance-category-filter",
21222122
conditions: [SearchCondition(pattern: "", anchoring: SearchAnchoring.`is`, context: "landing")],
2123-
consequence: SearchConsequence(params: SearchConsequenceParams(optionalFilters: SearchOptionalFilters
2123+
consequence: SearchConsequence(params: SearchConsequenceParams(
2124+
optionalFilters: SearchOptionalFilters
21242125
.string("clearance:true")
21252126
))
21262127
)
@@ -2166,7 +2167,8 @@ final class SearchClientSnippet {
21662167
rule: Rule(
21672168
objectID: "tomato-fruit",
21682169
conditions: [SearchCondition(pattern: "tomato", anchoring: SearchAnchoring.contains)],
2169-
consequence: SearchConsequence(params: SearchConsequenceParams(optionalFilters: SearchOptionalFilters
2170+
consequence: SearchConsequence(params: SearchConsequenceParams(
2171+
optionalFilters: SearchOptionalFilters
21702172
.string("food_group:fruit")
21712173
))
21722174
)
@@ -2329,8 +2331,9 @@ final class SearchClientSnippet {
23292331
objectID: "color-facets",
23302332
conditions: [SearchCondition(pattern: "{facet:color}")],
23312333
consequence: SearchConsequence(
2332-
params: SearchConsequenceParams(automaticFacetFilters: SearchAutomaticFacetFilters
2333-
.arrayOfSearchAutomaticFacetFilter([SearchAutomaticFacetFilter(facet: "color")])
2334+
params: SearchConsequenceParams(
2335+
automaticFacetFilters: SearchAutomaticFacetFilters
2336+
.arrayOfSearchAutomaticFacetFilter([SearchAutomaticFacetFilter(facet: "color")])
23342337
)
23352338
)
23362339
)
@@ -2535,7 +2538,8 @@ final class SearchClientSnippet {
25352538
objectID: "a-rule-id",
25362539
rule: Rule(
25372540
objectID: "a-rule-id",
2538-
consequence: SearchConsequence(params: SearchConsequenceParams(aroundRadius: SearchAroundRadius
2541+
consequence: SearchConsequence(params: SearchConsequenceParams(
2542+
aroundRadius: SearchAroundRadius
25392543
.int(1000)
25402544
)),
25412545
validity: [SearchTimeRange(from: Int64(1_577_836_800), until: Int64(1_577_836_800))]
@@ -3602,7 +3606,8 @@ final class SearchClientSnippet {
36023606
let response: SearchResponse<Hit> = try await client.searchSingleIndex(
36033607
indexName: "<YOUR_INDEX_NAME>",
36043608
searchParams: SearchSearchParams
3605-
.searchSearchParamsObject(SearchSearchParamsObject(facetFilters: SearchFacetFilters
3609+
.searchSearchParamsObject(SearchSearchParamsObject(
3610+
facetFilters: SearchFacetFilters
36063611
.arrayOfSearchFacetFilters([
36073612
SearchFacetFilters.string("publisher:Penguin"),
36083613
SearchFacetFilters.arrayOfSearchFacetFilters([
@@ -3721,7 +3726,8 @@ final class SearchClientSnippet {
37213726
let response: SearchResponse<Hit> = try await client.searchSingleIndex(
37223727
indexName: "<YOUR_INDEX_NAME>",
37233728
searchParams: SearchSearchParams
3724-
.searchSearchParamsObject(SearchSearchParamsObject(facetFilters: SearchFacetFilters
3729+
.searchSearchParamsObject(SearchSearchParamsObject(
3730+
facetFilters: SearchFacetFilters
37253731
.string("category:-Ebook")
37263732
))
37273733
)
@@ -3871,7 +3877,8 @@ final class SearchClientSnippet {
38713877
let response: SearchResponse<Hit> = try await client.searchSingleIndex(
38723878
indexName: "<YOUR_INDEX_NAME>",
38733879
searchParams: SearchSearchParams
3874-
.searchSearchParamsObject(SearchSearchParamsObject(insideBoundingBox: SearchInsideBoundingBox
3880+
.searchSearchParamsObject(SearchSearchParamsObject(
3881+
insideBoundingBox: SearchInsideBoundingBox
38753882
.arrayOfArrayOfDouble([[
38763883
49.067996905313834,
38773884
65.73828125,
@@ -3956,7 +3963,8 @@ final class SearchClientSnippet {
39563963
let response: SearchResponse<Hit> = try await client.searchSingleIndex(
39573964
indexName: "<YOUR_INDEX_NAME>",
39583965
searchParams: SearchSearchParams
3959-
.searchSearchParamsObject(SearchSearchParamsObject(optionalFilters: SearchOptionalFilters
3966+
.searchSearchParamsObject(SearchSearchParamsObject(
3967+
optionalFilters: SearchOptionalFilters
39603968
.arrayOfSearchOptionalFilters([SearchOptionalFilters.string("can_deliver_quickly:true")])
39613969
))
39623970
)
@@ -3976,7 +3984,8 @@ final class SearchClientSnippet {
39763984
let response: SearchResponse<Hit> = try await client.searchSingleIndex(
39773985
indexName: "<YOUR_INDEX_NAME>",
39783986
searchParams: SearchSearchParams
3979-
.searchSearchParamsObject(SearchSearchParamsObject(optionalFilters: SearchOptionalFilters
3987+
.searchSearchParamsObject(SearchSearchParamsObject(
3988+
optionalFilters: SearchOptionalFilters
39803989
.arrayOfSearchOptionalFilters([
39813990
SearchOptionalFilters.string("brand:Apple<score=3>"),
39823991
SearchOptionalFilters.string("brand:Samsung<score=2>"),
@@ -4000,7 +4009,8 @@ final class SearchClientSnippet {
40004009
let response: SearchResponse<Hit> = try await client.searchSingleIndex(
40014010
indexName: "<YOUR_INDEX_NAME>",
40024011
searchParams: SearchSearchParams
4003-
.searchSearchParamsObject(SearchSearchParamsObject(optionalFilters: SearchOptionalFilters
4012+
.searchSearchParamsObject(SearchSearchParamsObject(
4013+
optionalFilters: SearchOptionalFilters
40044014
.arrayOfSearchOptionalFilters([
40054015
SearchOptionalFilters.string("brand:Apple<score=2>"),
40064016
SearchOptionalFilters.string("type:tablet"),
@@ -4170,7 +4180,8 @@ final class SearchClientSnippet {
41704180
let response: SearchResponse<Hit> = try await client.searchSingleIndex(
41714181
indexName: "<YOUR_INDEX_NAME>",
41724182
searchParams: SearchSearchParams
4173-
.searchSearchParamsObject(SearchSearchParamsObject(facetFilters: SearchFacetFilters
4183+
.searchSearchParamsObject(SearchSearchParamsObject(
4184+
facetFilters: SearchFacetFilters
41744185
.arrayOfSearchFacetFilters([
41754186
SearchFacetFilters.string("user:user42"),
41764187
SearchFacetFilters.string("user:public"),
@@ -6180,8 +6191,9 @@ final class SearchClientSnippet {
61806191
// Call the API
61816192
let response = try await client.setSettings(
61826193
indexName: "<YOUR_INDEX_NAME>",
6183-
indexSettings: IndexSettings(typoTolerance: SearchTypoTolerance
6184-
.searchTypoToleranceEnum(SearchTypoToleranceEnum.min)
6194+
indexSettings: IndexSettings(
6195+
typoTolerance: SearchTypoTolerance
6196+
.searchTypoToleranceEnum(SearchTypoToleranceEnum.min)
61856197
),
61866198
forwardToReplicas: true
61876199
)
@@ -6218,8 +6230,9 @@ final class SearchClientSnippet {
62186230
// Call the API
62196231
let response = try await client.setSettings(
62206232
indexName: "<YOUR_INDEX_NAME>",
6221-
indexSettings: IndexSettings(ignorePlurals: SearchIgnorePlurals
6222-
.arrayOfSearchSupportedLanguage([SearchSupportedLanguage.fr])
6233+
indexSettings: IndexSettings(
6234+
ignorePlurals: SearchIgnorePlurals
6235+
.arrayOfSearchSupportedLanguage([SearchSupportedLanguage.fr])
62236236
),
62246237
forwardToReplicas: true
62256238
)
@@ -6256,8 +6269,9 @@ final class SearchClientSnippet {
62566269
// Call the API
62576270
let response = try await client.setSettings(
62586271
indexName: "<YOUR_INDEX_NAME>",
6259-
indexSettings: IndexSettings(removeStopWords: SearchRemoveStopWords
6260-
.arrayOfSearchSupportedLanguage([SearchSupportedLanguage.fr])
6272+
indexSettings: IndexSettings(
6273+
removeStopWords: SearchRemoveStopWords
6274+
.arrayOfSearchSupportedLanguage([SearchSupportedLanguage.fr])
62616275
),
62626276
forwardToReplicas: true
62636277
)

tests/output/swift/Tests/benchmark/SearchTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ final class SearchClientClientBenchmark: XCTestCase {
1313
let configuration = try SearchClientConfiguration(
1414
appID: "test-app-id",
1515
apiKey: "test-api-key",
16-
hosts: [RetryableHost(url: URL(string: "http://" +
16+
hosts: [RetryableHost(url: URL(
17+
string: "http://" +
1718
(ProcessInfo.processInfo.environment["CI"] == "true" ? "localhost" : "host.docker.internal") +
1819
":6682"
1920
)!)]

tests/output/swift/Tests/client/AbtestingTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ final class AbtestingClientClientTests: XCTestCase {
9797
appID: "test-app-id",
9898
apiKey: "test-api-key",
9999
region: Region(rawValue: "us"),
100-
hosts: [RetryableHost(url: URL(string: "http://" +
100+
hosts: [RetryableHost(url: URL(
101+
string: "http://" +
101102
(ProcessInfo.processInfo.environment["CI"] == "true" ? "localhost" : "host.docker.internal") +
102103
":6683"
103104
)!)]

tests/output/swift/Tests/client/AnalyticsTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ final class AnalyticsClientClientTests: XCTestCase {
104104
appID: "test-app-id",
105105
apiKey: "test-api-key",
106106
region: Region(rawValue: "us"),
107-
hosts: [RetryableHost(url: URL(string: "http://" +
107+
hosts: [RetryableHost(url: URL(
108+
string: "http://" +
108109
(ProcessInfo.processInfo.environment["CI"] == "true" ? "localhost" : "host.docker.internal") +
109110
":6683"
110111
)!)]

tests/output/swift/Tests/client/IngestionTests.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ final class IngestionClientClientTests: XCTestCase {
1717
appID: "test-app-id",
1818
apiKey: "test-api-key",
1919
region: Region(rawValue: "us"),
20-
hosts: [RetryableHost(url: URL(string: "http://" +
20+
hosts: [RetryableHost(url: URL(
21+
string: "http://" +
2122
(ProcessInfo.processInfo.environment["CI"] == "true" ? "localhost" : "host.docker.internal") +
2223
":6676"
2324
)!)]
@@ -65,7 +66,8 @@ final class IngestionClientClientTests: XCTestCase {
6566
appID: "test-app-id",
6667
apiKey: "test-api-key",
6768
region: Region(rawValue: "us"),
68-
hosts: [RetryableHost(url: URL(string: "http://" +
69+
hosts: [RetryableHost(url: URL(
70+
string: "http://" +
6971
(ProcessInfo.processInfo.environment["CI"] == "true" ? "localhost" : "host.docker.internal") +
7072
":6676"
7173
)!)]
@@ -186,7 +188,8 @@ final class IngestionClientClientTests: XCTestCase {
186188
appID: "test-app-id",
187189
apiKey: "test-api-key",
188190
region: Region(rawValue: "us"),
189-
hosts: [RetryableHost(url: URL(string: "http://" +
191+
hosts: [RetryableHost(url: URL(
192+
string: "http://" +
190193
(ProcessInfo.processInfo.environment["CI"] == "true" ? "localhost" : "host.docker.internal") +
191194
":6683"
192195
)!)]

tests/output/swift/Tests/client/InsightsTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ final class InsightsClientClientTests: XCTestCase {
111111
appID: "test-app-id",
112112
apiKey: "test-api-key",
113113
region: Region(rawValue: "us"),
114-
hosts: [RetryableHost(url: URL(string: "http://" +
114+
hosts: [RetryableHost(url: URL(
115+
string: "http://" +
115116
(ProcessInfo.processInfo.environment["CI"] == "true" ? "localhost" : "host.docker.internal") +
116117
":6683"
117118
)!)]

tests/output/swift/Tests/client/MonitoringTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ final class MonitoringClientClientTests: XCTestCase {
6363
let configuration = try MonitoringClientConfiguration(
6464
appID: "test-app-id",
6565
apiKey: "test-api-key",
66-
hosts: [RetryableHost(url: URL(string: "http://" +
66+
hosts: [RetryableHost(url: URL(
67+
string: "http://" +
6768
(ProcessInfo.processInfo.environment["CI"] == "true" ? "localhost" : "host.docker.internal") +
6869
":6683"
6970
)!)]

tests/output/swift/Tests/client/PersonalizationTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ final class PersonalizationClientClientTests: XCTestCase {
105105
appID: "test-app-id",
106106
apiKey: "test-api-key",
107107
region: Region(rawValue: "us"),
108-
hosts: [RetryableHost(url: URL(string: "http://" +
108+
hosts: [RetryableHost(url: URL(
109+
string: "http://" +
109110
(ProcessInfo.processInfo.environment["CI"] == "true" ? "localhost" : "host.docker.internal") +
110111
":6683"
111112
)!)]

tests/output/swift/Tests/client/QuerySuggestionsTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ final class QuerySuggestionsClientClientTests: XCTestCase {
105105
appID: "test-app-id",
106106
apiKey: "test-api-key",
107107
region: Region(rawValue: "us"),
108-
hosts: [RetryableHost(url: URL(string: "http://" +
108+
hosts: [RetryableHost(url: URL(
109+
string: "http://" +
109110
(ProcessInfo.processInfo.environment["CI"] == "true" ? "localhost" : "host.docker.internal") +
110111
":6683"
111112
)!)]

tests/output/swift/Tests/client/RecommendTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ final class RecommendClientClientTests: XCTestCase {
7575
let configuration = try RecommendClientConfiguration(
7676
appID: "test-app-id",
7777
apiKey: "test-api-key",
78-
hosts: [RetryableHost(url: URL(string: "http://" +
78+
hosts: [RetryableHost(url: URL(
79+
string: "http://" +
7980
(ProcessInfo.processInfo.environment["CI"] == "true" ? "localhost" : "host.docker.internal") +
8081
":6683"
8182
)!)]

0 commit comments

Comments
 (0)