diff --git a/clients/algoliasearch-client-swift/AlgoliaSearchClient.podspec b/clients/algoliasearch-client-swift/AlgoliaSearchClient.podspec index 6e858597349..ee375a5ffd8 100644 --- a/clients/algoliasearch-client-swift/AlgoliaSearchClient.podspec +++ b/clients/algoliasearch-client-swift/AlgoliaSearchClient.podspec @@ -2,15 +2,55 @@ Pod::Spec.new do |s| s.name = 'AlgoliaSearchClient' s.module_name = 'AlgoliaSearchClient' s.version = '9.0.0-alpha.10' - s.source = { :git => 'https://github.com/algolia/algoliasearch-client-swift.git', :branch => 'next' } + s.source = { :git => 'https://github.com/algolia/algoliasearch-client-swift.git', :tag => '9.0.0-alpha.10' } s.authors = { 'Algolia' => 'contact@algolia.com' } s.license = { :type => 'MIT', :file => 'LICENSE' } s.homepage = 'https://github.com/algolia/algoliasearch-client-swift/tree/next' s.summary = 'Algolia Search API Client written in Swift.' s.documentation_url = 'https://www.algolia.com/doc/api-client/getting-started/what-is-the-api-client/swift/' - s.source_files = 'Sources/**/*.swift' - s.platforms = { :ios => '13.0', :osx => '10.15', :watchos => '6.0', :tvos => '13.0' } + s.ios.deployment_target = '14.0' + s.osx.deployment_target = '11.0' + s.watchos.deployment_target = '7.0' + s.tvos.deployment_target = '14.0' s.swift_version = '5.9' - s.dependency 'AnyCodable-FlightSchool', '~> 0.6' - s.dependency 'apple-swift-log', '~> 1.4' + + s.subspec 'Core' do |subs| + subs.source_files = 'Sources/Core/**/*.swift' + end + s.subspec 'Abtesting' do |subs| + subs.source_files = 'Sources/Abtesting/**/*.swift' + subs.dependency 'AlgoliaSearchClient/Core' + end + s.subspec 'Analytics' do |subs| + subs.source_files = 'Sources/Analytics/**/*.swift' + subs.dependency 'AlgoliaSearchClient/Core' + end + s.subspec 'Ingestion' do |subs| + subs.source_files = 'Sources/Ingestion/**/*.swift' + subs.dependency 'AlgoliaSearchClient/Core' + end + s.subspec 'Insights' do |subs| + subs.source_files = 'Sources/Insights/**/*.swift' + subs.dependency 'AlgoliaSearchClient/Core' + end + s.subspec 'Monitoring' do |subs| + subs.source_files = 'Sources/Monitoring/**/*.swift' + subs.dependency 'AlgoliaSearchClient/Core' + end + s.subspec 'Personalization' do |subs| + subs.source_files = 'Sources/Personalization/**/*.swift' + subs.dependency 'AlgoliaSearchClient/Core' + end + s.subspec 'QuerySuggestions' do |subs| + subs.source_files = 'Sources/QuerySuggestions/**/*.swift' + subs.dependency 'AlgoliaSearchClient/Core' + end + s.subspec 'Recommend' do |subs| + subs.source_files = 'Sources/Recommend/**/*.swift' + subs.dependency 'AlgoliaSearchClient/Core' + end + s.subspec 'Search' do |subs| + subs.source_files = 'Sources/Search/**/*.swift' + subs.dependency 'AlgoliaSearchClient/Core' + end end diff --git a/clients/algoliasearch-client-swift/Package.swift b/clients/algoliasearch-client-swift/Package.swift index 1ee4303ecc0..efe7a3ae9b9 100644 --- a/clients/algoliasearch-client-swift/Package.swift +++ b/clients/algoliasearch-client-swift/Package.swift @@ -10,28 +10,42 @@ var targets: [Target] = [] var products: [Product] = [] #if os(Linux) - extraPackageDependencies.append( - .package(url: "https://github.com/apple/swift-crypto.git", from: "3.2.0") - ) - extraTargetDependencies.append( - .product(name: "Crypto", package: "swift-crypto") - ) + let macOSVersion: SupportedPlatform.MacOSVersion = .v10_15 +#else + let macOSVersion: SupportedPlatform.MacOSVersion = .v11 #endif -extraTargetDependencies.append(contentsOf: [ - .product(name: "AnyCodable", package: "AnyCodable"), - .product(name: "Logging", package: "swift-log"), -]) +#if os(Linux) + extraPackageDependencies.append(contentsOf: [ + .package(url: "https://github.com/apple/swift-crypto.git", from: "3.2.0"), + .package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"), + ]) + extraTargetDependencies.append(contentsOf: [ + .product(name: "Crypto", package: "swift-crypto"), + .product(name: "Logging", package: "swift-log"), + ]) +#endif -targets.append( - .target( - name: "Core", - dependencies: [ - .product(name: "Gzip", package: "GzipSwift"), - ] + extraTargetDependencies, - path: "Sources/Core" +#if os(Linux) + targets.append(contentsOf: [ + .systemLibrary(name: "zlib", pkgConfig: "zlib", providers: [.apt(["zlib1g-dev"])]), + .target( + name: "Core", + dependencies: [ + "zlib", + ] + extraTargetDependencies, + path: "Sources/Core" + ), + ]) +#else + targets.append( + .target( + name: "Core", + dependencies: extraTargetDependencies, + path: "Sources/Core" + ) ) -) +#endif products.append( .library( @@ -72,16 +86,12 @@ products.append( let package = Package( name: "AlgoliaSearchClient", platforms: [ - .iOS(.v13), - .macOS(.v10_15), - .tvOS(.v13), - .watchOS(.v6), + .iOS(.v14), + .macOS(macOSVersion), + .tvOS(.v14), + .watchOS(.v7), ], products: products, - dependencies: [ - .package(url: "https://github.com/Flight-School/AnyCodable", from: "0.6.7"), - .package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"), - .package(url: "https://github.com/1024jp/GzipSwift", from: "6.0.1"), - ] + extraPackageDependencies, + dependencies: extraPackageDependencies, targets: targets ) diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClient.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClient.swift index 169660a4674..bef03e6eb83 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClient.swift @@ -1,31 +1,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation - -typealias Client = AbtestingClient +#if canImport(Core) + import Core +#endif open class AbtestingClient { - private var configuration: Configuration + private var configuration: AbtestingClientConfiguration private var transporter: Transporter var appID: String { self.configuration.appID } - public init(configuration: Configuration, transporter: Transporter) { + public init(configuration: AbtestingClientConfiguration, transporter: Transporter) { self.configuration = configuration self.transporter = transporter } - public convenience init(configuration: Configuration) { + public convenience init(configuration: AbtestingClientConfiguration) { self.init(configuration: configuration, transporter: Transporter(configuration: configuration)) } public convenience init(appID: String, apiKey: String, region: Region?) throws { - try self.init(configuration: Configuration(appID: appID, apiKey: apiKey, region: region)) + try self.init(configuration: AbtestingClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } /// - parameter addABTestsRequest: (body) @@ -122,7 +121,7 @@ open class AbtestingClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -184,7 +183,7 @@ open class AbtestingClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -252,7 +251,7 @@ open class AbtestingClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -320,7 +319,7 @@ open class AbtestingClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -475,7 +474,7 @@ open class AbtestingClient { ) async throws -> Response { let resourcePath = "/2/abtests" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "offset": offset?.encodeToJSON(), "limit": limit?.encodeToJSON(), "indexPrefix": indexPrefix?.encodeToJSON(), diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Configuration.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClientConfiguration.swift similarity index 95% rename from clients/algoliasearch-client-swift/Sources/Abtesting/Configuration.swift rename to clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClientConfiguration.swift index 1e95356aa28..54ab48a1002 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Configuration.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/AbtestingClientConfiguration.swift @@ -1,13 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -typealias AbtestingClientConfiguration = Configuration - -public struct Configuration: Core.Configuration, Credentials { +public struct AbtestingClientConfiguration: BaseConfiguration, Credentials { private let authorizedRegions: [Region] = [ Region.de, Region.us, ] diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ABTest.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ABTest.swift index c3268d60cce..2d5206fa8f7 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ABTest.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ABTest.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ABTest: Codable, JSONEncodable, Hashable { /// Unique A/B test ID. diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ABTestResponse.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ABTestResponse.swift index 27b367c4a2a..5178f7ea4e0 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ABTestResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ABTestResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ABTestResponse: Codable, JSONEncodable, Hashable { /// A/B test index. diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AbTestsVariant.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AbTestsVariant.swift index 7421b8c2846..2eee219b49f 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AbTestsVariant.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AbTestsVariant.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct AbTestsVariant: Codable, JSONEncodable, Hashable { /// A/B test index. diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AbTestsVariantSearchParams.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AbTestsVariantSearchParams.swift index 645395fbddd..4b9a219652a 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AbTestsVariantSearchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AbTestsVariantSearchParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct AbTestsVariantSearchParams: Codable, JSONEncodable, Hashable { /// A/B test index. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AbtestingErrorBase.swift similarity index 95% rename from clients/algoliasearch-client-swift/Sources/Ingestion/Models/ErrorBase.swift rename to clients/algoliasearch-client-swift/Sources/Abtesting/Models/AbtestingErrorBase.swift index 29817fdeb5c..751bd3510fc 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ErrorBase.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AbtestingErrorBase.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Error. -public struct ErrorBase: Codable, JSONEncodable, Hashable { +public struct AbtestingErrorBase: Codable, JSONEncodable, Hashable { public var message: String? public init(message: String? = nil) { diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AddABTestsRequest.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AddABTestsRequest.swift index 90af21cd77b..5104363ce82 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AddABTestsRequest.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AddABTestsRequest.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct AddABTestsRequest: Codable, JSONEncodable, Hashable { /// A/B test name. diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AddABTestsVariant.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AddABTestsVariant.swift index 4654bbdd06f..dc73d2addeb 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AddABTestsVariant.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/AddABTestsVariant.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum AddABTestsVariant: Codable, JSONEncodable, AbstractEncodable, Hashable { case abTestsVariant(AbTestsVariant) diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/CurrenciesValue.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/CurrenciesValue.swift index 208e2a014e5..1a47d01d236 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/CurrenciesValue.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/CurrenciesValue.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct CurrenciesValue: Codable, JSONEncodable, Hashable { /// Currency code. diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/CustomSearchParams.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/CustomSearchParams.swift index 0e23f4fd9c7..8fbb4ca72fe 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/CustomSearchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/CustomSearchParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Applies search parameters from [a restricted set of /// options](https://www.algolia.com/doc/api-reference/api-methods/add-ab-test/#method-param-customsearchparameters). diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffects.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffects.swift index 638adabc9e8..41ad807ca3b 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffects.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffects.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// A/B test filter effects resulting from configuration settings. public struct FilterEffects: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffectsEmptySearch.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffectsEmptySearch.swift index 20ac842fe7a..b87a4f1cc4f 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffectsEmptySearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffectsEmptySearch.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Empty searches removed from the A/B test as a result of configuration settings. public struct FilterEffectsEmptySearch: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffectsOutliers.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffectsOutliers.swift index ebd757e8a24..00b44405a1c 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffectsOutliers.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/FilterEffectsOutliers.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Outliers removed from the A/B test as a result of configuration settings. public struct FilterEffectsOutliers: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ListABTestsResponse.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ListABTestsResponse.swift index 3b0c70c6c21..c8716a46df0 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ListABTestsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ListABTestsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ListABTestsResponse: Codable, JSONEncodable, Hashable { /// A/B tests. diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/Variant.swift b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/Variant.swift index be812660f43..bfa05e9363e 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/Variant.swift +++ b/clients/algoliasearch-client-swift/Sources/Abtesting/Models/Variant.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct Variant: Codable, JSONEncodable, Hashable { /// Number of add-to-cart events for this variant. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClient.swift b/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClient.swift index d37a0e25f4a..99744a73f44 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClient.swift @@ -1,31 +1,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation - -typealias Client = AnalyticsClient +#if canImport(Core) + import Core +#endif open class AnalyticsClient { - private var configuration: Configuration + private var configuration: AnalyticsClientConfiguration private var transporter: Transporter var appID: String { self.configuration.appID } - public init(configuration: Configuration, transporter: Transporter) { + public init(configuration: AnalyticsClientConfiguration, transporter: Transporter) { self.configuration = configuration self.transporter = transporter } - public convenience init(configuration: Configuration) { + public convenience init(configuration: AnalyticsClientConfiguration) { self.init(configuration: configuration, transporter: Transporter(configuration: configuration)) } public convenience init(appID: String, apiKey: String, region: Region?) throws { - try self.init(configuration: Configuration(appID: appID, apiKey: apiKey, region: region)) + try self.init(configuration: AnalyticsClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } /// - parameter path: (path) Path of the endpoint, anything after \"/1\" must be specified. @@ -76,7 +75,7 @@ open class AnalyticsClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -138,7 +137,7 @@ open class AnalyticsClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -206,7 +205,7 @@ open class AnalyticsClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -274,7 +273,7 @@ open class AnalyticsClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -351,7 +350,7 @@ open class AnalyticsClient { let resourcePath = "/2/clicks/averageClickPosition" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "startDate": startDate?.encodeToJSON(), "endDate": endDate?.encodeToJSON(), @@ -433,7 +432,7 @@ open class AnalyticsClient { let resourcePath = "/2/clicks/positions" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "startDate": startDate?.encodeToJSON(), "endDate": endDate?.encodeToJSON(), @@ -514,7 +513,7 @@ open class AnalyticsClient { let resourcePath = "/2/clicks/clickThroughRate" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "startDate": startDate?.encodeToJSON(), "endDate": endDate?.encodeToJSON(), @@ -595,7 +594,7 @@ open class AnalyticsClient { let resourcePath = "/2/conversions/conversionRate" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "startDate": startDate?.encodeToJSON(), "endDate": endDate?.encodeToJSON(), @@ -676,7 +675,7 @@ open class AnalyticsClient { let resourcePath = "/2/searches/noClickRate" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "startDate": startDate?.encodeToJSON(), "endDate": endDate?.encodeToJSON(), @@ -756,7 +755,7 @@ open class AnalyticsClient { let resourcePath = "/2/searches/noResultRate" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "startDate": startDate?.encodeToJSON(), "endDate": endDate?.encodeToJSON(), @@ -836,7 +835,7 @@ open class AnalyticsClient { let resourcePath = "/2/searches/count" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "startDate": startDate?.encodeToJSON(), "endDate": endDate?.encodeToJSON(), @@ -928,7 +927,7 @@ open class AnalyticsClient { let resourcePath = "/2/searches/noClicks" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "startDate": startDate?.encodeToJSON(), "endDate": endDate?.encodeToJSON(), @@ -1022,7 +1021,7 @@ open class AnalyticsClient { let resourcePath = "/2/searches/noResults" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "startDate": startDate?.encodeToJSON(), "endDate": endDate?.encodeToJSON(), @@ -1078,7 +1077,7 @@ open class AnalyticsClient { let resourcePath = "/2/status" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), ] @@ -1167,7 +1166,7 @@ open class AnalyticsClient { let resourcePath = "/2/countries" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "startDate": startDate?.encodeToJSON(), "endDate": endDate?.encodeToJSON(), @@ -1269,7 +1268,7 @@ open class AnalyticsClient { let resourcePath = "/2/filters" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "search": search?.encodeToJSON(), "startDate": startDate?.encodeToJSON(), @@ -1389,7 +1388,7 @@ open class AnalyticsClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "search": search?.encodeToJSON(), "startDate": startDate?.encodeToJSON(), @@ -1491,7 +1490,7 @@ open class AnalyticsClient { let resourcePath = "/2/filters/noResults" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "search": search?.encodeToJSON(), "startDate": startDate?.encodeToJSON(), @@ -1602,7 +1601,7 @@ open class AnalyticsClient { let resourcePath = "/2/hits" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "search": search?.encodeToJSON(), "clickAnalytics": clickAnalytics?.encodeToJSON(), @@ -1720,7 +1719,7 @@ open class AnalyticsClient { let resourcePath = "/2/searches" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "clickAnalytics": clickAnalytics?.encodeToJSON(), "startDate": startDate?.encodeToJSON(), @@ -1805,7 +1804,7 @@ open class AnalyticsClient { let resourcePath = "/2/users/count" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "index": index.encodeToJSON(), "startDate": startDate?.encodeToJSON(), "endDate": endDate?.encodeToJSON(), diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Configuration.swift b/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClientConfiguration.swift similarity index 95% rename from clients/algoliasearch-client-swift/Sources/Analytics/Configuration.swift rename to clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClientConfiguration.swift index 3244db8eeb8..0da070eb748 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Configuration.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/AnalyticsClientConfiguration.swift @@ -1,13 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -typealias AnalyticsClientConfiguration = Configuration - -public struct Configuration: Core.Configuration, Credentials { +public struct AnalyticsClientConfiguration: BaseConfiguration, Credentials { private let authorizedRegions: [Region] = [ Region.de, Region.us, ] diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/ErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/AnalyticsErrorBase.swift similarity index 95% rename from clients/algoliasearch-client-swift/Sources/Analytics/Models/ErrorBase.swift rename to clients/algoliasearch-client-swift/Sources/Analytics/Models/AnalyticsErrorBase.swift index 29817fdeb5c..e77014054d3 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/ErrorBase.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/AnalyticsErrorBase.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Error. -public struct ErrorBase: Codable, JSONEncodable, Hashable { +public struct AnalyticsErrorBase: Codable, JSONEncodable, Hashable { public var message: String? public init(message: String? = nil) { diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/AverageClickEvent.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/AverageClickEvent.swift index 9b5fa7fb7bc..766fdfa7502 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/AverageClickEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/AverageClickEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct AverageClickEvent: Codable, JSONEncodable, Hashable { /// Average count of all click events. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/ClickPosition.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/ClickPosition.swift index 090d03e1e0b..41dc61b4b6a 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/ClickPosition.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/ClickPosition.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ClickPosition: Codable, JSONEncodable, Hashable { /// Range of positions with the following pattern: - For positions 1 to 10, the number of click events are shown for diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/ClickThroughRateEvent.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/ClickThroughRateEvent.swift index f4a57b5c436..f997acaedca 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/ClickThroughRateEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/ClickThroughRateEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ClickThroughRateEvent: Codable, JSONEncodable, Hashable { static let rateRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/ConversionRateEvent.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/ConversionRateEvent.swift index be41da899f4..d78b60d1762 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/ConversionRateEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/ConversionRateEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ConversionRateEvent: Codable, JSONEncodable, Hashable { static let rateRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/Direction.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/Direction.swift index 0348157e3e0..24114817465 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/Direction.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/Direction.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum Direction: String, Codable, CaseIterable { case asc diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetAverageClickPositionResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetAverageClickPositionResponse.swift index d492b90fc34..06b623905c5 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetAverageClickPositionResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetAverageClickPositionResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetAverageClickPositionResponse: Codable, JSONEncodable, Hashable { /// Average count of all click events. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetClickPositionsResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetClickPositionsResponse.swift index a83aaf31cd3..927be0e3c20 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetClickPositionsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetClickPositionsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetClickPositionsResponse: Codable, JSONEncodable, Hashable { /// Click positions. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetClickThroughRateResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetClickThroughRateResponse.swift index 0c781134ad8..8d534955315 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetClickThroughRateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetClickThroughRateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetClickThroughRateResponse: Codable, JSONEncodable, Hashable { static let rateRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetConversationRateResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetConversationRateResponse.swift index a872cc9b212..fc588ee8274 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetConversationRateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetConversationRateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetConversationRateResponse: Codable, JSONEncodable, Hashable { static let rateRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetNoClickRateResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetNoClickRateResponse.swift index a8d435a36cf..af59aae9eec 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetNoClickRateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetNoClickRateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetNoClickRateResponse: Codable, JSONEncodable, Hashable { static let rateRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetNoResultsRateResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetNoResultsRateResponse.swift index 4f537b5d27d..90e7d3f0cad 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetNoResultsRateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetNoResultsRateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetNoResultsRateResponse: Codable, JSONEncodable, Hashable { static let rateRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesCountResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesCountResponse.swift index 02ead4d5880..8c29c9d8e1f 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesCountResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesCountResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetSearchesCountResponse: Codable, JSONEncodable, Hashable { /// Number of occurrences. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesNoClicksResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesNoClicksResponse.swift index 42a530293a3..772a5b51c49 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesNoClicksResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesNoClicksResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetSearchesNoClicksResponse: Codable, JSONEncodable, Hashable { /// Searches with no clicks. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesNoResultsResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesNoResultsResponse.swift index dc7b4e598be..86f5bc27eb5 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesNoResultsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetSearchesNoResultsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetSearchesNoResultsResponse: Codable, JSONEncodable, Hashable { /// Searches with no results. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetStatusResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetStatusResponse.swift index 9a2b8478cc7..59cd7887b22 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetStatusResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetStatusResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetStatusResponse: Codable, JSONEncodable, Hashable { /// Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopCountriesResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopCountriesResponse.swift index b05b79c2d45..5735166d49e 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopCountriesResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopCountriesResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetTopCountriesResponse: Codable, JSONEncodable, Hashable { /// Countries diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterAttribute.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterAttribute.swift index 5043732eed7..069a6ff4365 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterAttribute.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterAttribute.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetTopFilterAttribute: Codable, JSONEncodable, Hashable { /// Attribute name. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterAttributesResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterAttributesResponse.swift index d63e3038761..236cbff95b0 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterAttributesResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterAttributesResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetTopFilterAttributesResponse: Codable, JSONEncodable, Hashable { /// Filterable attributes. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterForAttribute.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterForAttribute.swift index c81c6f42ca1..5a1fb67b03f 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterForAttribute.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterForAttribute.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetTopFilterForAttribute: Codable, JSONEncodable, Hashable { /// Attribute name. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterForAttributeResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterForAttributeResponse.swift index 1812c1e075f..b580d55b2b7 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterForAttributeResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFilterForAttributeResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetTopFilterForAttributeResponse: Codable, JSONEncodable, Hashable { /// Filter values for an attribute. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsResponse.swift index 9ecc475812c..24a6f9896f6 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetTopFiltersNoResultsResponse: Codable, JSONEncodable, Hashable { /// Filters with no results. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsValue.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsValue.swift index 050859658bb..3dea5014fcb 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsValue.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsValue.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetTopFiltersNoResultsValue: Codable, JSONEncodable, Hashable { /// Attribute name. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsValues.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsValues.swift index bbf0a62b528..6af77352a6f 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsValues.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopFiltersNoResultsValues.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetTopFiltersNoResultsValues: Codable, JSONEncodable, Hashable { /// Number of occurrences. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopHitsResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopHitsResponse.swift index a9b94972bd4..3987e913f27 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopHitsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopHitsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum GetTopHitsResponse: Codable, JSONEncodable, AbstractEncodable, Hashable { case topHitsResponse(TopHitsResponse) diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopSearchesResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopSearchesResponse.swift index 61362352c9b..1f96f3bc069 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopSearchesResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetTopSearchesResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum GetTopSearchesResponse: Codable, JSONEncodable, AbstractEncodable, Hashable { case topSearchesResponse(TopSearchesResponse) diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetUsersCountResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetUsersCountResponse.swift index 017967d8371..eab89a5334f 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetUsersCountResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/GetUsersCountResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetUsersCountResponse: Codable, JSONEncodable, Hashable { /// Number of occurrences. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/NoClickRateEvent.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/NoClickRateEvent.swift index d330c79565d..98a27d7c78b 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/NoClickRateEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/NoClickRateEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct NoClickRateEvent: Codable, JSONEncodable, Hashable { static let rateRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/NoResultsRateEvent.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/NoResultsRateEvent.swift index e6d88d6c864..7259d0079e6 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/NoResultsRateEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/NoResultsRateEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct NoResultsRateEvent: Codable, JSONEncodable, Hashable { static let rateRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/OrderBy.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/OrderBy.swift index f7229e25586..f181d7b0f86 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/OrderBy.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/OrderBy.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Method for ordering results. `clickThroughRate`, `conversionRate` and /// `averageClickPosition` are only available if the `clickAnalytics` parameter is `true`. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchEvent.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchEvent.swift index b4dbf3e3bf4..476694fff01 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchEvent: Codable, JSONEncodable, Hashable { /// Date of the event in the format YYYY-MM-DD. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchNoClickEvent.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchNoClickEvent.swift index 56ea047b70e..c2e4e8ecce8 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchNoClickEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchNoClickEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchNoClickEvent: Codable, JSONEncodable, Hashable { /// User query. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchNoResultEvent.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchNoResultEvent.swift index c2f893eb608..36f9ea1133d 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchNoResultEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/SearchNoResultEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchNoResultEvent: Codable, JSONEncodable, Hashable { /// User query. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopCountry.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopCountry.swift index ddc756c6b40..d5b9da33b3c 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopCountry.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopCountry.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TopCountry: Codable, JSONEncodable, Hashable { /// Country. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHit.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHit.swift index 290672bef95..90d75bea77c 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHit.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHit.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TopHit: Codable, JSONEncodable, Hashable { /// Hit. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitWithAnalytics.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitWithAnalytics.swift index 0190300eab1..280fa8311a3 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitWithAnalytics.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitWithAnalytics.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TopHitWithAnalytics: Codable, JSONEncodable, Hashable { static let clickThroughRateRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitsResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitsResponse.swift index d89b22f3fbc..14d0a27ecd9 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TopHitsResponse: Codable, JSONEncodable, Hashable { /// Top hits. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitsResponseWithAnalytics.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitsResponseWithAnalytics.swift index 6d81be72749..af423dc388e 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitsResponseWithAnalytics.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopHitsResponseWithAnalytics.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TopHitsResponseWithAnalytics: Codable, JSONEncodable, Hashable { /// Top hits. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearch.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearch.swift index e66fdfa7ced..d324e6c39ab 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearch.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TopSearch: Codable, JSONEncodable, Hashable { /// User query. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchWithAnalytics.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchWithAnalytics.swift index 24d981f3a05..3a864e67a3f 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchWithAnalytics.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchWithAnalytics.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TopSearchWithAnalytics: Codable, JSONEncodable, Hashable { static let clickThroughRateRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchesResponse.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchesResponse.swift index 7ebdaaa0f8a..b3390878e15 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchesResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchesResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TopSearchesResponse: Codable, JSONEncodable, Hashable { /// Top searches with their hits count. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchesResponseWithAnalytics.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchesResponseWithAnalytics.swift index abcdb6e5501..b5519e5801a 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchesResponseWithAnalytics.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/TopSearchesResponseWithAnalytics.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TopSearchesResponseWithAnalytics: Codable, JSONEncodable, Hashable { /// Top searches with their hits count and analytics. diff --git a/clients/algoliasearch-client-swift/Sources/Analytics/Models/UserWithDate.swift b/clients/algoliasearch-client-swift/Sources/Analytics/Models/UserWithDate.swift index 037709b938b..615667598c4 100644 --- a/clients/algoliasearch-client-swift/Sources/Analytics/Models/UserWithDate.swift +++ b/clients/algoliasearch-client-swift/Sources/Analytics/Models/UserWithDate.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct UserWithDate: Codable, JSONEncodable, Hashable { /// Date of the event in the format YYYY-MM-DD. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClient.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClient.swift index e369017c30b..0c800901a64 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClient.swift @@ -1,31 +1,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation - -typealias Client = IngestionClient +#if canImport(Core) + import Core +#endif open class IngestionClient { - private var configuration: Configuration + private var configuration: IngestionClientConfiguration private var transporter: Transporter var appID: String { self.configuration.appID } - public init(configuration: Configuration, transporter: Transporter) { + public init(configuration: IngestionClientConfiguration, transporter: Transporter) { self.configuration = configuration self.transporter = transporter } - public convenience init(configuration: Configuration) { + public convenience init(configuration: IngestionClientConfiguration) { self.init(configuration: configuration, transporter: Transporter(configuration: configuration)) } public convenience init(appID: String, apiKey: String, region: Region) throws { - try self.init(configuration: Configuration(appID: appID, apiKey: apiKey, region: region)) + try self.init(configuration: IngestionClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } /// - parameter authenticationCreate: (body) @@ -265,7 +264,7 @@ open class IngestionClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -327,7 +326,7 @@ open class IngestionClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -395,7 +394,7 @@ open class IngestionClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -463,7 +462,7 @@ open class IngestionClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -953,7 +952,7 @@ open class IngestionClient { ) async throws -> Response { let resourcePath = "/1/authentications" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "itemsPerPage": itemsPerPage?.encodeToJSON(), "page": page?.encodeToJSON(), "type": type?.encodeToJSON(), @@ -1096,7 +1095,7 @@ open class IngestionClient { ) async throws -> Response { let resourcePath = "/1/destinations" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "itemsPerPage": itemsPerPage?.encodeToJSON(), "page": page?.encodeToJSON(), "type": type?.encodeToJSON(), @@ -1351,7 +1350,7 @@ open class IngestionClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "itemsPerPage": itemsPerPage?.encodeToJSON(), "page": page?.encodeToJSON(), "status": status?.encodeToJSON(), @@ -1508,7 +1507,7 @@ open class IngestionClient { ) async throws -> Response { let resourcePath = "/1/runs" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "itemsPerPage": itemsPerPage?.encodeToJSON(), "page": page?.encodeToJSON(), "status": status?.encodeToJSON(), @@ -1532,10 +1531,10 @@ open class IngestionClient { } /// - parameter sourceID: (path) The source UUID. - /// - returns: Source + /// - returns: IngestionSource @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open func getSource(sourceID: String, requestOptions: RequestOptions? = nil) async throws -> Source { - let response: Response = try await getSourceWithHTTPInfo( + open func getSource(sourceID: String, requestOptions: RequestOptions? = nil) async throws -> IngestionSource { + let response: Response = try await getSourceWithHTTPInfo( sourceID: sourceID, requestOptions: requestOptions ) @@ -1554,12 +1553,12 @@ open class IngestionClient { // - editSettings // // - parameter sourceID: (path) The source UUID. - // - returns: RequestBuilder + // - returns: RequestBuilder open func getSourceWithHTTPInfo( sourceID: String, requestOptions userRequestOptions: RequestOptions? = nil - ) async throws -> Response { + ) async throws -> Response { guard !sourceID.isEmpty else { throw AlgoliaError.invalidArgument("sourceID", "getSource") } @@ -1655,7 +1654,7 @@ open class IngestionClient { ) async throws -> Response { let resourcePath = "/1/sources" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "itemsPerPage": itemsPerPage?.encodeToJSON(), "page": page?.encodeToJSON(), "type": type?.encodeToJSON(), @@ -1813,7 +1812,7 @@ open class IngestionClient { ) async throws -> Response { let resourcePath = "/1/tasks" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "itemsPerPage": itemsPerPage?.encodeToJSON(), "page": page?.encodeToJSON(), "action": action?.encodeToJSON(), @@ -1992,13 +1991,13 @@ open class IngestionClient { } /// - parameter sourceSearch: (body) - /// - returns: [Source] + /// - returns: [IngestionSource] @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func searchSources( sourceSearch: SourceSearch, requestOptions: RequestOptions? = nil - ) async throws -> [Source] { - let response: Response<[Source]> = try await searchSourcesWithHTTPInfo( + ) async throws -> [IngestionSource] { + let response: Response<[IngestionSource]> = try await searchSourcesWithHTTPInfo( sourceSearch: sourceSearch, requestOptions: requestOptions ) @@ -2017,12 +2016,12 @@ open class IngestionClient { // - editSettings // // - parameter sourceSearch: (body) - // - returns: RequestBuilder<[Source]> + // - returns: RequestBuilder<[IngestionSource]> open func searchSourcesWithHTTPInfo( sourceSearch: SourceSearch, requestOptions userRequestOptions: RequestOptions? = nil - ) async throws -> Response<[Source]> { + ) async throws -> Response<[IngestionSource]> { let resourcePath = "/1/sources/search" let body = sourceSearch let queryParameters: [String: Any?]? = nil diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Configuration.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClientConfiguration.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Ingestion/Configuration.swift rename to clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClientConfiguration.swift index 947716079fa..af7d53d357c 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Configuration.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/IngestionClientConfiguration.swift @@ -1,13 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -typealias IngestionClientConfiguration = Configuration - -public struct Configuration: Core.Configuration, Credentials { +public struct IngestionClientConfiguration: BaseConfiguration, Credentials { private let authorizedRegions: [Region] = [ Region.eu, Region.us, ] diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ActionType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ActionType.swift index 7ae5798e117..beb939c0fde 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ActionType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ActionType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The action to perform on the Algolia index. public enum ActionType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAPIKey.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAPIKey.swift index ca9421cde6a..5bc3e1e4c3f 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAPIKey.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAPIKey.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Authentication input used for token credentials. public struct AuthAPIKey: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAPIKeyPartial.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAPIKeyPartial.swift index da54812a1f4..70770b3264e 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAPIKeyPartial.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAPIKeyPartial.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Authentication input used for token credentials. public struct AuthAPIKeyPartial: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAlgolia.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAlgolia.swift index 3bf6289fc4a..ab23457127e 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAlgolia.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAlgolia.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct AuthAlgolia: Codable, JSONEncodable, Hashable { /// Algolia Application ID. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAlgoliaPartial.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAlgoliaPartial.swift index 327f19c4865..444e90b6c29 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAlgoliaPartial.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthAlgoliaPartial.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct AuthAlgoliaPartial: Codable, JSONEncodable, Hashable { /// Algolia Application ID. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthBasic.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthBasic.swift index e06dd96da4d..24ac43c00a7 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthBasic.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthBasic.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Authentication input for Basic login with username and password. public struct AuthBasic: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthBasicPartial.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthBasicPartial.swift index 76c02db40d4..c640e03818a 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthBasicPartial.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthBasicPartial.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Authentication input for Basic login with username and password. public struct AuthBasicPartial: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthGoogleServiceAccount.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthGoogleServiceAccount.swift index 043cf00a360..31d23e22bea 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthGoogleServiceAccount.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthGoogleServiceAccount.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Authentication input to connect to a Google service (e.g. BigQuery). public struct AuthGoogleServiceAccount: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthGoogleServiceAccountPartial.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthGoogleServiceAccountPartial.swift index 76dddfe209d..0e595c481eb 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthGoogleServiceAccountPartial.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthGoogleServiceAccountPartial.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Authentication input to connect to a Google service (e.g. BigQuery). public struct AuthGoogleServiceAccountPartial: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthInput.swift index dc2cf6bb5f1..481597779fe 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum AuthInput: Codable, JSONEncodable, AbstractEncodable, Hashable { case authAPIKey(AuthAPIKey) diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthInputPartial.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthInputPartial.swift index 699e99b48c9..fbc93f0e6ee 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthInputPartial.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthInputPartial.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum AuthInputPartial: Codable, JSONEncodable, AbstractEncodable, Hashable { case authAPIKeyPartial(AuthAPIKeyPartial) diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthOAuth.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthOAuth.swift index 438d11b061f..9e0a544ef80 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthOAuth.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthOAuth.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Authentication input for OAuth login. public struct AuthOAuth: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthOAuthPartial.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthOAuthPartial.swift index 0247ed9d9bd..fb3190087cf 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthOAuthPartial.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthOAuthPartial.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Authentication input for OAuth login. public struct AuthOAuthPartial: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Authentication.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Authentication.swift index 1bf5d617d2a..865015924e7 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Authentication.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Authentication.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// An authentication is used to login into a Source or a Destination, with obfuscated input. public struct Authentication: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationCreate.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationCreate.swift index e1db815c852..99df3c9accd 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationCreate.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationCreate.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The payload when creating an authentication. public struct AuthenticationCreate: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationCreateResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationCreateResponse.swift index 19207954a64..ecf317de856 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationCreateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationCreateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Response from the API when the Authentication is successfully created. public struct AuthenticationCreateResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationSearch.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationSearch.swift index ae1276cbd15..3c79c6ea0ae 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationSearch.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Payload to search for multiple authentications, based on the given `authenticationIDs`. public struct AuthenticationSearch: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationSortKeys.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationSortKeys.swift index d9d9ec807d7..f4da1a8c9e9 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationSortKeys.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationSortKeys.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Used to sort the Authentication list endpoint. public enum AuthenticationSortKeys: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationType.swift index cc5ba453747..0f211bfa323 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Type of the Authentication, defines what kind of object is stored in the input. public enum AuthenticationType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationUpdate.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationUpdate.swift index cb003ada6ac..a798d12fb61 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationUpdate.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationUpdate.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Payload to partially update an Authentication. public struct AuthenticationUpdate: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationUpdateResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationUpdateResponse.swift index e13e1d405e3..cd714b16c0d 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationUpdateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/AuthenticationUpdateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Response from the API when the Authentication is successfully updated. public struct AuthenticationUpdateResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigCommerceChannel.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigCommerceChannel.swift index d3099dd49ae..d90a3486a6e 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigCommerceChannel.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigCommerceChannel.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BigCommerceChannel: Codable, JSONEncodable, Hashable { /// The ID of the bigcommerce channel. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigCommerceMetafield.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigCommerceMetafield.swift index a7fdf70264e..3ad41a8f1f3 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigCommerceMetafield.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigCommerceMetafield.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BigCommerceMetafield: Codable, JSONEncodable, Hashable { /// The namespace of the metafield. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigQueryDataType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigQueryDataType.swift index 84311204918..252d1e22953 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigQueryDataType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/BigQueryDataType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum BigQueryDataType: String, Codable, CaseIterable { case ga4 diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/CommercetoolsCustomFields.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/CommercetoolsCustomFields.swift index bcce7f25b03..a146aab21c7 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/CommercetoolsCustomFields.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/CommercetoolsCustomFields.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Custom fields from Commercetools to index in the records (see /// https://docs.commercetools.com/tutorials/custom-types). diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DeleteResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DeleteResponse.swift index 1982120eb75..bd01564ebfe 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DeleteResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DeleteResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct DeleteResponse: Codable, JSONEncodable, Hashable { /// Date of deletion (RFC3339 format). diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Destination.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Destination.swift index 7a4581ba880..3dc0850c932 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Destination.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Destination.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// A destination describe how the data is indexed on the Algolia side. public struct Destination: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationCreate.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationCreate.swift index 0233480f4c7..b50010ac596 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationCreate.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationCreate.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The payload when creating a destination. public struct DestinationCreate: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationCreateResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationCreateResponse.swift index 0cf9da50377..a296d2f76ea 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationCreateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationCreateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Response from the API when the Destination is successfully created. public struct DestinationCreateResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationIndexName.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationIndexName.swift index dbf64d0c0f1..2c7c3d4834c 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationIndexName.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationIndexName.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct DestinationIndexName: Codable, JSONEncodable, Hashable { /// The index name to store data in. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationIndexPrefix.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationIndexPrefix.swift index ae3f619a2c8..8a520735ae3 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationIndexPrefix.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationIndexPrefix.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct DestinationIndexPrefix: Codable, JSONEncodable, Hashable { /// The prefix of the final index name. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationInput.swift index 2ecffbadb21..70f75a0407b 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum DestinationInput: Codable, JSONEncodable, AbstractEncodable, Hashable { case destinationIndexName(DestinationIndexName) diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationSearch.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationSearch.swift index 593a1ae1709..6a1a6641385 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationSearch.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Payload to search for multiple destinations, based on the given `destinationIDs`. public struct DestinationSearch: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationSortKeys.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationSortKeys.swift index fbfc994c716..e96b1373cf6 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationSortKeys.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationSortKeys.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Used to sort the Destination list endpoint. public enum DestinationSortKeys: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationType.swift index 74b0201cb06..01c9e2a6261 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Type of the Destination, defines in which Algolia product the data will be stored. public enum DestinationType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationUpdate.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationUpdate.swift index d61667aafd7..73cb30a6ab4 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationUpdate.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationUpdate.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Payload to partially update a Destination. public struct DestinationUpdate: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationUpdateResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationUpdateResponse.swift index d5bea6a250e..081b9f90b50 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationUpdateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DestinationUpdateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Response from the API when the Destination is successfully updated. public struct DestinationUpdateResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerImageType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerImageType.swift index a89e5161dbe..bd26e5034c8 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerImageType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerImageType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The type of the image. public enum DockerImageType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerRegistry.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerRegistry.swift index 6aee94f480e..590607b7e9f 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerRegistry.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerRegistry.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The registry where the image is stored. public enum DockerRegistry: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerSourceDiscover.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerSourceDiscover.swift index d68118e2a4b..c28aebf0300 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerSourceDiscover.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerSourceDiscover.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct DockerSourceDiscover: Codable, JSONEncodable, Hashable { /// The run UUID. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerSourceStreams.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerSourceStreams.swift index 5cc1fcd05c1..37520c41ff8 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerSourceStreams.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/DockerSourceStreams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct DockerSourceStreams: Codable, JSONEncodable, Hashable { public var streams: [AnyCodable] diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Event.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Event.swift index 770eeff661e..095339bc347 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Event.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Event.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// An event describe a step of the task execution flow.. public struct Event: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventSortKeys.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventSortKeys.swift index 696a6894769..412d2c35fbe 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventSortKeys.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventSortKeys.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Used to sort the Event list endpoint. public enum EventSortKeys: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventStatus.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventStatus.swift index 600d76d3916..529dd24faab 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventStatus.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventStatus.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum EventStatus: String, Codable, CaseIterable { case created diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventType.swift index 6266abc52d6..8e5b2a550c3 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/EventType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum EventType: String, Codable, CaseIterable { case fetch diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/IngestionErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/IngestionErrorBase.swift new file mode 100644 index 00000000000..fccd0a591ee --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/IngestionErrorBase.swift @@ -0,0 +1,72 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +/// Error. +public struct IngestionErrorBase: Codable, JSONEncodable, Hashable { + public var message: String? + + public init(message: String? = nil) { + self.message = message + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case message + } + + public var additionalProperties: [String: AnyCodable] = [:] + + public subscript(key: String) -> AnyCodable? { + get { + if let value = additionalProperties[key] { + return value + } + return nil + } + + set { + self.additionalProperties[key] = newValue + } + } + + public init(from dictionary: [String: AnyCodable]) throws { + self.message = dictionary["message"]?.value as? String + + for (key, value) in dictionary { + switch key { + case "message": + continue + default: + self.additionalProperties[key] = value + } + } + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(self.message, forKey: .message) + var additionalPropertiesContainer = encoder.container(keyedBy: String.self) + try additionalPropertiesContainer.encodeMap(self.additionalProperties) + } + + // Decodable protocol methods + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.message = try container.decodeIfPresent(String.self, forKey: .message) + var nonAdditionalPropertyKeys = Set() + nonAdditionalPropertyKeys.insert("message") + let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) + self.additionalProperties = try additionalPropertiesContainer.decodeMap( + AnyCodable.self, + excludedKeys: nonAdditionalPropertyKeys + ) + } +} diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Source.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/IngestionSource.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Ingestion/Models/Source.swift rename to clients/algoliasearch-client-swift/Sources/Ingestion/Models/IngestionSource.swift index 2523a846de7..1d43735554d 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Source.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/IngestionSource.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct Source: Codable, JSONEncodable, Hashable { +public struct IngestionSource: Codable, JSONEncodable, Hashable { /// The source UUID. public var sourceID: String public var type: SourceType diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListAuthenticationsResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListAuthenticationsResponse.swift index f0bf85687f5..ef3fda59907 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListAuthenticationsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListAuthenticationsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ListAuthenticationsResponse: Codable, JSONEncodable, Hashable { public var authentications: [Authentication] diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListDestinationsResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListDestinationsResponse.swift index 1ebb8705440..850299d4a6d 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListDestinationsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListDestinationsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ListDestinationsResponse: Codable, JSONEncodable, Hashable { public var destinations: [Destination] diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListEventsResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListEventsResponse.swift index 66c3ebe4f85..85e200ac4aa 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListEventsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListEventsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ListEventsResponse: Codable, JSONEncodable, Hashable { public var events: [Event] diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListSourcesResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListSourcesResponse.swift index c63c117c0b0..9fd8775c107 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListSourcesResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListSourcesResponse.swift @@ -1,15 +1,16 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ListSourcesResponse: Codable, JSONEncodable, Hashable { - public var sources: [Source] + public var sources: [IngestionSource] public var pagination: Pagination - public init(sources: [Source], pagination: Pagination) { + public init(sources: [IngestionSource], pagination: Pagination) { self.sources = sources self.pagination = pagination } diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListTasksResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListTasksResponse.swift index 043a70a4c70..67114675fbb 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListTasksResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListTasksResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// A list of tasks with pagination details. public struct ListTasksResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingFieldDirective.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingFieldDirective.swift index f04678cfedb..862b6a9f11d 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingFieldDirective.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingFieldDirective.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Describes how a field should be resolved by applying a set of directives. public struct MappingFieldDirective: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingInput.swift index a7127400040..edb19998a98 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Transformations to apply to source, serialized as a JSON string. public struct MappingInput: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingKitAction.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingKitAction.swift index 004efdb9912..6416efc5096 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingKitAction.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingKitAction.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Describes how a destination object should be resolved by means of applying a set of directives. public struct MappingKitAction: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingTypeCSV.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingTypeCSV.swift index ccea89216dd..6d117145d90 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingTypeCSV.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MappingTypeCSV.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum MappingTypeCSV: String, Codable, CaseIterable { case string diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MethodType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MethodType.swift index 7f365a672d7..ed7f5cbf21e 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MethodType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/MethodType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum MethodType: String, Codable, CaseIterable { case `get` = "GET" diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandDateUtilsInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandDateUtilsInput.swift index ca6be70b5a0..288f52d6d7a 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandDateUtilsInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandDateUtilsInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The input for an `onDemand` task whose source is of type `bigquery` and for which extracted data /// spans a given time range. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTrigger.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTrigger.swift index 82fd99659aa..40494069503 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTrigger.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTrigger.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The trigger information of a task of type `onDemand`. public struct OnDemandTrigger: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTriggerInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTriggerInput.swift index b1cfd0f4dd7..e9c3883d1ed 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTriggerInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTriggerInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The trigger information of a task of type `onDemand`. public struct OnDemandTriggerInput: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTriggerType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTriggerType.swift index 3b804e979ce..36e3894b2c3 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTriggerType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OnDemandTriggerType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// A task which is manually executed via the run task endpoint. public enum OnDemandTriggerType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OrderKeys.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OrderKeys.swift index 884ff0411fd..35c9b5c4095 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OrderKeys.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/OrderKeys.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Used to order a sorted request. public enum OrderKeys: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Pagination.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Pagination.swift index dcb0f1776c2..45c765d6216 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Pagination.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Pagination.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct Pagination: Codable, JSONEncodable, Hashable { public var nbPages: Int diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Platform.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Platform.swift index 3586782f981..6b2de9e7ca6 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Platform.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Platform.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Describe which platform the Authentication is used for. public enum Platform: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/PlatformNone.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/PlatformNone.swift index 108cdb3b169..88dd2cfe645 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/PlatformNone.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/PlatformNone.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Used to filter Authentication without platform property. public enum PlatformNone: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/PlatformWithNone.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/PlatformWithNone.swift index b79f2b82a12..a23c417aa8f 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/PlatformWithNone.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/PlatformWithNone.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum PlatformWithNone: Codable, JSONEncodable, AbstractEncodable, Hashable { case platform(Platform) diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RecordType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RecordType.swift index e28d3ffb859..7dfb6721a6c 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RecordType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RecordType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Determines the indexing strategy to use for a given e-commerce source. public enum RecordType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Run.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Run.swift index e16e02f6192..f193f155b7e 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Run.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Run.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct Run: Codable, JSONEncodable, Hashable { static let failureThresholdRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunListResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunListResponse.swift index 162b638e1ec..a723bda9304 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunListResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunListResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct RunListResponse: Codable, JSONEncodable, Hashable { public var runs: [Run] diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunOutcome.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunOutcome.swift index a14a74893d1..4c614e4b594 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunOutcome.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunOutcome.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum RunOutcome: String, Codable, CaseIterable { case success diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunProgress.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunProgress.swift index 4fe8b08215c..e3dd9591b95 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunProgress.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunProgress.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct RunProgress: Codable, JSONEncodable, Hashable { public var expectedNbOfEvents: Int? diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunReasonCode.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunReasonCode.swift index c475ed9e9a8..ea5945c7622 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunReasonCode.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunReasonCode.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// An identifier that pairs with the outcome reason. public enum RunReasonCode: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunResponse.swift index 7d40c0bd0e8..5076291734e 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The response from the run task API, containing an Observability Run ID and the time it was created at. public struct RunResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunSortKeys.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunSortKeys.swift index 8763bf65e5b..4a59b36d894 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunSortKeys.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunSortKeys.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Used to sort the Run list endpoint. public enum RunSortKeys: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunStatus.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunStatus.swift index e9d6d6d4487..1d3950f6695 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunStatus.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunStatus.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum RunStatus: String, Codable, CaseIterable { case created diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunType.swift index 05210f79d17..69a783aa775 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/RunType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum RunType: String, Codable, CaseIterable { case reindex diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleDateUtilsInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleDateUtilsInput.swift index 50d6a33bc9d..4eadc67241a 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleDateUtilsInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleDateUtilsInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The input for a `schedule` task whose source is of type `bigquery` and for which extracted data /// spans a fixed number of days. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTrigger.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTrigger.swift index 196717b95e8..3d662c927c6 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTrigger.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTrigger.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The trigger information for a task of type 'schedule'. public struct ScheduleTrigger: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTriggerInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTriggerInput.swift index aa281176c35..76971fcbfc5 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTriggerInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTriggerInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The trigger input for a task of type 'schedule'. public struct ScheduleTriggerInput: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTriggerType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTriggerType.swift index 0c60109475e..9573c5ec058 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTriggerType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/ScheduleTriggerType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// A task which is triggered by a schedule (cron expression). public enum ScheduleTriggerType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceBigCommerce.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceBigCommerce.swift index a2b803303cc..be7f425a816 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceBigCommerce.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceBigCommerce.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceBigCommerce: Codable, JSONEncodable, Hashable { /// The store hash identifying the store the shopper is signing in to. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceBigQuery.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceBigQuery.swift index dab03283a72..6f53c23fa10 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceBigQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceBigQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceBigQuery: Codable, JSONEncodable, Hashable { /// Project ID of the BigQuery Source. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCSV.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCSV.swift index 5cebb0ca237..990879a59f9 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCSV.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCSV.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceCSV: Codable, JSONEncodable, Hashable { static let delimiterRule = StringRule(minLength: 1, maxLength: 1, pattern: nil) diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCommercetools.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCommercetools.swift index 01f75dbfa10..4831a10a4c7 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCommercetools.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCommercetools.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceCommercetools: Codable, JSONEncodable, Hashable { public var storeKeys: [String]? diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCreate.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCreate.swift index 00d1d269906..9c6236a3ea4 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCreate.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCreate.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceCreate: Codable, JSONEncodable, Hashable { public var type: SourceType diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCreateResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCreateResponse.swift index e05cf0c9cbd..4830428eeed 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCreateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceCreateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceCreateResponse: Codable, JSONEncodable, Hashable { /// The source UUID. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceDocker.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceDocker.swift index 80ff67dfa6c..1c8ebceb4aa 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceDocker.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceDocker.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceDocker: Codable, JSONEncodable, Hashable { public var imageType: DockerImageType diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceGA4BigQueryExport.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceGA4BigQueryExport.swift index 9df348dbbce..53aede7e824 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceGA4BigQueryExport.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceGA4BigQueryExport.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceGA4BigQueryExport: Codable, JSONEncodable, Hashable { /// GCP project ID that the BigQuery Export writes to. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceInput.swift index 4e96b67a003..19644612301 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum SourceInput: Codable, JSONEncodable, AbstractEncodable, Hashable { case sourceBigCommerce(SourceBigCommerce) diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceJSON.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceJSON.swift index 2a115be8318..79abc5216fe 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceJSON.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceJSON.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceJSON: Codable, JSONEncodable, Hashable { /// The URL of the file. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceSearch.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceSearch.swift index e72386fba53..e9b70b30da9 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceSearch.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceSearch: Codable, JSONEncodable, Hashable { public var sourceIDs: [String] diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceSortKeys.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceSortKeys.swift index 3a5671f4492..c277bb03ef8 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceSortKeys.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceSortKeys.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Used to sort the Source list endpoint. public enum SourceSortKeys: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceType.swift index 1b613912ed2..4f45b151980 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum SourceType: String, Codable, CaseIterable { case bigcommerce diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdate.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdate.swift index 0fb2ae007b5..b2012078f56 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdate.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdate.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceUpdate: Codable, JSONEncodable, Hashable { public var name: String? diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateCommercetools.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateCommercetools.swift index 18dc00fc3a3..48ff05a9e03 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateCommercetools.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateCommercetools.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceUpdateCommercetools: Codable, JSONEncodable, Hashable { /// Unique and immutable key of the referenced Store. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateDocker.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateDocker.swift index de8fa398dce..0e683b75b72 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateDocker.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateDocker.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceUpdateDocker: Codable, JSONEncodable, Hashable { public var registry: DockerRegistry? diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateInput.swift index c86e264efd3..491a834f0db 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum SourceUpdateInput: Codable, JSONEncodable, AbstractEncodable, Hashable { case sourceBigQuery(SourceBigQuery) diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateResponse.swift index e066434c30b..51734592d4d 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SourceUpdateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SourceUpdateResponse: Codable, JSONEncodable, Hashable { /// The source UUID. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingTrigger.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingTrigger.swift index aec6c142f29..ceb886d00ec 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingTrigger.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingTrigger.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The trigger input for a task of type 'streaming'. public struct StreamingTrigger: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingTriggerType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingTriggerType.swift index 65c1c130aa1..dba64f6aa0a 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingTriggerType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingTriggerType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// A task that runs continuously. public enum StreamingTriggerType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingUtilsInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingUtilsInput.swift index cb6af8753ad..89ded3e226d 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingUtilsInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/StreamingUtilsInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The input for a `streaming` task whose source is of type `ga4BigqueryExport` and for which /// extracted data is continuously streamed. diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SubscriptionTrigger.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SubscriptionTrigger.swift index d49e168d2fa..8f66bde9293 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SubscriptionTrigger.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SubscriptionTrigger.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The trigger input for a task of type 'subscription'. public struct SubscriptionTrigger: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SubscriptionTriggerType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SubscriptionTriggerType.swift index 27e83ceeddc..e96238a5fe3 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SubscriptionTriggerType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/SubscriptionTriggerType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// A task which is triggered by an external subscription (e.g. Webhook). public enum SubscriptionTriggerType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Task.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Task.swift index 6d6bdc01d11..a1564a9bbe8 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Task.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Task.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct Task: Codable, JSONEncodable, Hashable { static let failureThresholdRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreate.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreate.swift index 86a5d53ce77..3892c0929a3 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreate.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreate.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The payload for a task creation. public struct TaskCreate: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreateResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreateResponse.swift index dd9cbaa458e..53aa6aef1c6 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The response from the API after a task creation. public struct TaskCreateResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreateTrigger.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreateTrigger.swift index aef5e2dd8f8..8a842460fd7 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreateTrigger.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskCreateTrigger.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum TaskCreateTrigger: Codable, JSONEncodable, AbstractEncodable, Hashable { case onDemandTriggerInput(OnDemandTriggerInput) diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskInput.swift index e962e701367..6e37d293b8a 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum TaskInput: Codable, JSONEncodable, AbstractEncodable, Hashable { case onDemandDateUtilsInput(OnDemandDateUtilsInput) diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskSearch.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskSearch.swift index c1cc28ee441..4e9338e2d62 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskSearch.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TaskSearch: Codable, JSONEncodable, Hashable { public var taskIDs: [String] diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskSortKeys.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskSortKeys.swift index ba7070c7577..84fc725af75 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskSortKeys.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskSortKeys.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Used to sort the Task list endpoint. public enum TaskSortKeys: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskUpdate.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskUpdate.swift index 0e5286958dd..52c3d7d5b2e 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskUpdate.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskUpdate.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The payload for a task update. public struct TaskUpdate: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskUpdateResponse.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskUpdateResponse.swift index 818afc6e971..174ac2fdc74 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskUpdateResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TaskUpdateResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The response from the API after a task update. public struct TaskUpdateResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Trigger.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Trigger.swift index 45df3ba3a47..4a3cba82f9d 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Trigger.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Trigger.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum Trigger: Codable, JSONEncodable, AbstractEncodable, Hashable { case onDemandTrigger(OnDemandTrigger) diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TriggerType.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TriggerType.swift index a4a7f8d8854..ce5a5be8100 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TriggerType.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TriggerType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The type of the task reflect how it can be used: - onDemand: a task that runs manually - schedule: a task that /// runs regularly, following a given cron expression - subscription: a task that runs after a subscription event is diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TriggerUpdateInput.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TriggerUpdateInput.swift index 9a3677e251a..d38bacbde8f 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TriggerUpdateInput.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/TriggerUpdateInput.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The trigger input for a task update. public struct TriggerUpdateInput: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Window.swift b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Window.swift index 7843f9ad90a..fc94bdc340d 100644 --- a/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Window.swift +++ b/clients/algoliasearch-client-swift/Sources/Ingestion/Models/Window.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The window parameter represents the holds the dates used to query the Observability data from the database in a /// given window. diff --git a/clients/algoliasearch-client-swift/Sources/Insights/InsightsClient.swift b/clients/algoliasearch-client-swift/Sources/Insights/InsightsClient.swift index f36caa6f8f6..766c83a1a8b 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/InsightsClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/InsightsClient.swift @@ -1,31 +1,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation - -typealias Client = InsightsClient +#if canImport(Core) + import Core +#endif open class InsightsClient { - private var configuration: Configuration + private var configuration: InsightsClientConfiguration private var transporter: Transporter var appID: String { self.configuration.appID } - public init(configuration: Configuration, transporter: Transporter) { + public init(configuration: InsightsClientConfiguration, transporter: Transporter) { self.configuration = configuration self.transporter = transporter } - public convenience init(configuration: Configuration) { + public convenience init(configuration: InsightsClientConfiguration) { self.init(configuration: configuration, transporter: Transporter(configuration: configuration)) } public convenience init(appID: String, apiKey: String, region: Region?) throws { - try self.init(configuration: Configuration(appID: appID, apiKey: apiKey, region: region)) + try self.init(configuration: InsightsClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } /// - parameter path: (path) Path of the endpoint, anything after \"/1\" must be specified. @@ -76,7 +75,7 @@ open class InsightsClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -138,7 +137,7 @@ open class InsightsClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -206,7 +205,7 @@ open class InsightsClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -274,7 +273,7 @@ open class InsightsClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Configuration.swift b/clients/algoliasearch-client-swift/Sources/Insights/InsightsClientConfiguration.swift similarity index 95% rename from clients/algoliasearch-client-swift/Sources/Insights/Configuration.swift rename to clients/algoliasearch-client-swift/Sources/Insights/InsightsClientConfiguration.swift index 971f8859723..d1262e16901 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Configuration.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/InsightsClientConfiguration.swift @@ -1,13 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -typealias InsightsClientConfiguration = Configuration - -public struct Configuration: Core.Configuration, Credentials { +public struct InsightsClientConfiguration: BaseConfiguration, Credentials { private let authorizedRegions: [Region] = [ Region.de, Region.us, ] diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/AddToCartEvent.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/AddToCartEvent.swift index 017e6ae869c..7e1803c8b66 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/AddToCartEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/AddToCartEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum AddToCartEvent: String, Codable, CaseIterable { case addToCart diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/AddedToCartObjectIDs.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/AddedToCartObjectIDs.swift index 6dd6e18c949..ddcd58acfae 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/AddedToCartObjectIDs.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/AddedToCartObjectIDs.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Use this event to track when users add items to their shopping cart unrelated to a previous Algolia request. For /// example, if you don't use Algolia to build your category pages, use this event. To track add-to-cart events @@ -38,7 +39,7 @@ public struct AddedToCartObjectIDs: Codable, JSONEncodable, Hashable { /// Timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, /// the Insights API uses the time it receives an event as its timestamp. public var timestamp: Int64? - public var value: Value? + public var value: InsightsValue? public init( eventName: String, @@ -51,7 +52,7 @@ public struct AddedToCartObjectIDs: Codable, JSONEncodable, Hashable { currency: String? = nil, objectData: [ObjectData]? = nil, timestamp: Int64? = nil, - value: Value? = nil + value: InsightsValue? = nil ) { self.eventName = eventName self.eventType = eventType diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/AddedToCartObjectIDsAfterSearch.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/AddedToCartObjectIDsAfterSearch.swift index 8bbeea17b5e..cf83ebbe2dd 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/AddedToCartObjectIDsAfterSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/AddedToCartObjectIDsAfterSearch.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Use this event to track when users add items to their shopping cart after a previous Algolia request. If you're /// building your category pages with Algolia, you'll also use this event. @@ -41,7 +42,7 @@ public struct AddedToCartObjectIDsAfterSearch: Codable, JSONEncodable, Hashable /// Timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, /// the Insights API uses the time it receives an event as its timestamp. public var timestamp: Int64? - public var value: Value? + public var value: InsightsValue? public init( eventName: String, @@ -55,7 +56,7 @@ public struct AddedToCartObjectIDsAfterSearch: Codable, JSONEncodable, Hashable currency: String? = nil, objectData: [ObjectDataAfterSearch]? = nil, timestamp: Int64? = nil, - value: Value? = nil + value: InsightsValue? = nil ) { self.eventName = eventName self.eventType = eventType diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickEvent.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickEvent.swift index 4e0c2006776..d531a84e245 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum ClickEvent: String, Codable, CaseIterable { case click diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedFilters.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedFilters.swift index dee13f5c851..021a2891d66 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedFilters.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Use this event to track when users click facet filters in your user interface. public struct ClickedFilters: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedObjectIDs.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedObjectIDs.swift index 8e1e74819d9..5465e6544e6 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedObjectIDs.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedObjectIDs.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Use this event to track when users click items unrelated to a previous Algolia request. For example, if you /// don't use Algolia to build your category pages, use this event. To track click events related to Algolia diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedObjectIDsAfterSearch.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedObjectIDsAfterSearch.swift index fa7446c44c4..72c54679f78 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedObjectIDsAfterSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ClickedObjectIDsAfterSearch.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Click event after an Algolia request. Use this event to track when users click items in the search results. If /// you're building your category pages with Algolia, you'll also use this event. diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ConversionEvent.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ConversionEvent.swift index 703d51c6553..a2573712578 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ConversionEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ConversionEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum ConversionEvent: String, Codable, CaseIterable { case conversion diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedFilters.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedFilters.swift index 612746201a7..22a003ec2c5 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedFilters.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ConvertedFilters: Codable, JSONEncodable, Hashable { static let eventNameRule = StringRule(minLength: 1, maxLength: 64, pattern: "[\\x20-\\x7E]{1,64}") diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedObjectIDs.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedObjectIDs.swift index ddda1178780..ee3d8e12a6b 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedObjectIDs.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedObjectIDs.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Use this event to track when users convert on items unrelated to a previous Algolia request. For example, if you /// don't use Algolia to build your category pages, use this event. To track conversion events related to Algolia diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedObjectIDsAfterSearch.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedObjectIDsAfterSearch.swift index 92a10efe43b..6d09d926ef0 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedObjectIDsAfterSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ConvertedObjectIDsAfterSearch.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Use this event to track when users convert after a previous Algolia request. For example, a user clicks on an item /// in the search results to view the product detail page. Then, the user adds the item to their shopping cart. If diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/Discount.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/Discount.swift index 8ff96b97979..96bc0877b44 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/Discount.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/Discount.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Absolute value of the discount for this product, in units of `currency`. public enum Discount: Codable, JSONEncodable, AbstractEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/EventsItems.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/EventsItems.swift index 85143a99bc0..97381e69fe8 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/EventsItems.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/EventsItems.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum EventsItems: Codable, JSONEncodable, AbstractEncodable, Hashable { case addedToCartObjectIDs(AddedToCartObjectIDs) diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/EventsResponse.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/EventsResponse.swift index a10f03c0cb9..5b251e3b7c0 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/EventsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/EventsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The response of the Insights API. public struct EventsResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/InsightsErrorBase.swift similarity index 95% rename from clients/algoliasearch-client-swift/Sources/Abtesting/Models/ErrorBase.swift rename to clients/algoliasearch-client-swift/Sources/Insights/Models/InsightsErrorBase.swift index 29817fdeb5c..81f51d6556f 100644 --- a/clients/algoliasearch-client-swift/Sources/Abtesting/Models/ErrorBase.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/InsightsErrorBase.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Error. -public struct ErrorBase: Codable, JSONEncodable, Hashable { +public struct InsightsErrorBase: Codable, JSONEncodable, Hashable { public var message: String? public init(message: String? = nil) { diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/InsightsEvents.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/InsightsEvents.swift index 22229524cef..a0b938c4077 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/InsightsEvents.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/InsightsEvents.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct InsightsEvents: Codable, JSONEncodable, Hashable { /// Click and conversion events. **All** events must be valid, otherwise the API returns an error. diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/Value.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/InsightsValue.swift similarity index 88% rename from clients/algoliasearch-client-swift/Sources/Insights/Models/Value.swift rename to clients/algoliasearch-client-swift/Sources/Insights/Models/InsightsValue.swift index 0b598ca8a70..c72816ba8e8 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/Value.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/InsightsValue.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Total monetary value of this event in units of `currency`. -public enum Value: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum InsightsValue: Codable, JSONEncodable, AbstractEncodable, Hashable { case double(Double) case string(String) @@ -29,7 +30,7 @@ public enum Value: Codable, JSONEncodable, AbstractEncodable, Hashable { } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of Value") + .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of InsightsValue") ) } } diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ObjectData.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ObjectData.swift index 7ae11cd019d..ceff55f0789 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ObjectData.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ObjectData.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ObjectData: Codable, JSONEncodable, Hashable { public var price: Price? diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ObjectDataAfterSearch.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ObjectDataAfterSearch.swift index 72374770c10..68cf43d994a 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ObjectDataAfterSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ObjectDataAfterSearch.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ObjectDataAfterSearch: Codable, JSONEncodable, Hashable { static let queryIDRule = StringRule(minLength: 32, maxLength: 32, pattern: "[0-9a-f]{32}") diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/Price.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/Price.swift index 9bc53612388..697786b5b60 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/Price.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/Price.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Total price of a product, including any discounts, in units of `currency`. public enum Price: Codable, JSONEncodable, AbstractEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchaseEvent.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchaseEvent.swift index 581cf1c289c..8e8913c38c5 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchaseEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchaseEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum PurchaseEvent: String, Codable, CaseIterable { case purchase diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchasedObjectIDs.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchasedObjectIDs.swift index 1c33dc00367..25176a5cf9d 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchasedObjectIDs.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchasedObjectIDs.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Use this event to track when users make a purchase unrelated to a previous Algolia request. For example, if you /// don't use Algolia to build your category pages, use this event. To track purchase events related to Algolia @@ -38,7 +39,7 @@ public struct PurchasedObjectIDs: Codable, JSONEncodable, Hashable { /// Timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, /// the Insights API uses the time it receives an event as its timestamp. public var timestamp: Int64? - public var value: Value? + public var value: InsightsValue? public init( eventName: String, @@ -51,7 +52,7 @@ public struct PurchasedObjectIDs: Codable, JSONEncodable, Hashable { currency: String? = nil, objectData: [ObjectData]? = nil, timestamp: Int64? = nil, - value: Value? = nil + value: InsightsValue? = nil ) { self.eventName = eventName self.eventType = eventType diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchasedObjectIDsAfterSearch.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchasedObjectIDsAfterSearch.swift index 4996c77e4cb..bf7434afce4 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchasedObjectIDsAfterSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/PurchasedObjectIDsAfterSearch.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Use this event to track when users make a purchase after a previous Algolia request. If you're building your /// category pages with Algolia, you'll also use this event. @@ -37,7 +38,7 @@ public struct PurchasedObjectIDsAfterSearch: Codable, JSONEncodable, Hashable { /// Timestamp of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, /// the Insights API uses the time it receives an event as its timestamp. public var timestamp: Int64? - public var value: Value? + public var value: InsightsValue? public init( eventName: String, @@ -50,7 +51,7 @@ public struct PurchasedObjectIDsAfterSearch: Codable, JSONEncodable, Hashable { currency: String? = nil, objectData: [ObjectDataAfterSearch]? = nil, timestamp: Int64? = nil, - value: Value? = nil + value: InsightsValue? = nil ) { self.eventName = eventName self.eventType = eventType diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewEvent.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewEvent.swift index 9edb65fff29..7972a418c0a 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewEvent.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewEvent.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum ViewEvent: String, Codable, CaseIterable { case view diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewedFilters.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewedFilters.swift index 117b8b3940a..874f2545c18 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewedFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewedFilters.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Use this method to capture active filters. For example, when browsing a category page, users see content filtered on /// that specific category. diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewedObjectIDs.swift b/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewedObjectIDs.swift index cff5a1f3dc8..5cd9a3d10e1 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewedObjectIDs.swift +++ b/clients/algoliasearch-client-swift/Sources/Insights/Models/ViewedObjectIDs.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Use this event to track when users viewed items in the search results. public struct ViewedObjectIDs: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ErrorBase.swift deleted file mode 100644 index 29817fdeb5c..00000000000 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ErrorBase.swift +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -/// Error. -public struct ErrorBase: Codable, JSONEncodable, Hashable { - public var message: String? - - public init(message: String? = nil) { - self.message = message - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case message - } - - public var additionalProperties: [String: AnyCodable] = [:] - - public subscript(key: String) -> AnyCodable? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - self.additionalProperties[key] = newValue - } - } - - public init(from dictionary: [String: AnyCodable]) throws { - self.message = dictionary["message"]?.value as? String - - for (key, value) in dictionary { - switch key { - case "message": - continue - default: - self.additionalProperties[key] = value - } - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(self.message, forKey: .message) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(self.additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - self.message = try container.decodeIfPresent(String.self, forKey: .message) - var nonAdditionalPropertyKeys = Set() - nonAdditionalPropertyKeys.insert("message") - let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) - self.additionalProperties = try additionalPropertiesContainer.decodeMap( - AnyCodable.self, - excludedKeys: nonAdditionalPropertyKeys - ) - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/GetInventory403Response.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/GetInventory403Response.swift index 280f9b670f9..9b78b2700fd 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/GetInventory403Response.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/GetInventory403Response.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetInventory403Response: Codable, JSONEncodable, Hashable { public var reason: String? diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Incident.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Incident.swift index 418799824bc..3f14a2604b1 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Incident.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Incident.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Incident details. public struct Incident: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IncidentsInner.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IncidentsInner.swift index dc25fdf39ee..5c22a4fad50 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IncidentsInner.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IncidentsInner.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct IncidentsInner: Codable, JSONEncodable, Hashable { /// Timestamp in [Unix epoch time](https://wikipedia.org/wiki/Unix_time) in milliseconds. diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IncidentsResponse.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IncidentsResponse.swift index 046a8dfb566..629837eebe2 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IncidentsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IncidentsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct IncidentsResponse: Codable, JSONEncodable, Hashable { public var incidents: [String: [IncidentsInner]]? diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IndexingTimeResponse.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IndexingTimeResponse.swift index cda4515bef1..599ce14a69f 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IndexingTimeResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IndexingTimeResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct IndexingTimeResponse: Codable, JSONEncodable, Hashable { public var metrics: IndexingTimeResponseMetrics? diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IndexingTimeResponseMetrics.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IndexingTimeResponseMetrics.swift index e6fc84b28c5..1b19de237e2 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IndexingTimeResponseMetrics.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/IndexingTimeResponseMetrics.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct IndexingTimeResponseMetrics: Codable, JSONEncodable, Hashable { public var indexing: [String: [TimeInner]]? diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InfrastructureResponse.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InfrastructureResponse.swift index f1fb763fed4..d57ebc88a8c 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InfrastructureResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InfrastructureResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct InfrastructureResponse: Codable, JSONEncodable, Hashable { public var metrics: InfrastructureResponseMetrics? diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InfrastructureResponseMetrics.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InfrastructureResponseMetrics.swift index 00450506cec..d3ecb8dbc98 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InfrastructureResponseMetrics.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InfrastructureResponseMetrics.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct InfrastructureResponseMetrics: Codable, JSONEncodable, Hashable { /// CPU idleness in %. diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InventoryResponse.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InventoryResponse.swift index 93e3bc38407..71dbe462f74 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InventoryResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/InventoryResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct InventoryResponse: Codable, JSONEncodable, Hashable { public var inventory: [Server]? diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/LatencyResponse.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/LatencyResponse.swift index 53476273652..c634063f6fb 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/LatencyResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/LatencyResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct LatencyResponse: Codable, JSONEncodable, Hashable { public var metrics: LatencyResponseMetrics? diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/LatencyResponseMetrics.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/LatencyResponseMetrics.swift index 904d7cdadc0..ef27d6e3c21 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/LatencyResponseMetrics.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/LatencyResponseMetrics.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct LatencyResponseMetrics: Codable, JSONEncodable, Hashable { public var latency: [String: [TimeInner]]? diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Metric.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Metric.swift index d81bcd1e6d7..408f987e0ae 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Metric.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Metric.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum Metric: String, Codable, CaseIterable { case avgBuildTime = "avg_build_time" diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ModelType.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ModelType.swift index 31c66bbf8b2..80a6ef0c47b 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ModelType.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ModelType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum ModelType: String, Codable, CaseIterable { case cluster diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/MonitoringErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/MonitoringErrorBase.swift new file mode 100644 index 00000000000..a4d0762d0c9 --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/MonitoringErrorBase.swift @@ -0,0 +1,72 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +/// Error. +public struct MonitoringErrorBase: Codable, JSONEncodable, Hashable { + public var message: String? + + public init(message: String? = nil) { + self.message = message + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case message + } + + public var additionalProperties: [String: AnyCodable] = [:] + + public subscript(key: String) -> AnyCodable? { + get { + if let value = additionalProperties[key] { + return value + } + return nil + } + + set { + self.additionalProperties[key] = newValue + } + } + + public init(from dictionary: [String: AnyCodable]) throws { + self.message = dictionary["message"]?.value as? String + + for (key, value) in dictionary { + switch key { + case "message": + continue + default: + self.additionalProperties[key] = value + } + } + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(self.message, forKey: .message) + var additionalPropertiesContainer = encoder.container(keyedBy: String.self) + try additionalPropertiesContainer.encodeMap(self.additionalProperties) + } + + // Decodable protocol methods + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.message = try container.decodeIfPresent(String.self, forKey: .message) + var nonAdditionalPropertyKeys = Set() + nonAdditionalPropertyKeys.insert("message") + let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) + self.additionalProperties = try additionalPropertiesContainer.decodeMap( + AnyCodable.self, + excludedKeys: nonAdditionalPropertyKeys + ) + } +} diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Region.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/MonitoringRegion.swift similarity index 80% rename from clients/algoliasearch-client-swift/Sources/Monitoring/Models/Region.swift rename to clients/algoliasearch-client-swift/Sources/Monitoring/Models/MonitoringRegion.swift index f0941edce9e..2128de5f8eb 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Region.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/MonitoringRegion.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The region where the cluster is located. -public enum Region: String, Codable, CaseIterable { +public enum MonitoringRegion: String, Codable, CaseIterable { case au case br case ca diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Period.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Period.swift index e914de5bb8b..47895a51ace 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Period.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Period.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum Period: String, Codable, CaseIterable { case minute diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ProbesMetric.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ProbesMetric.swift index b4bac8772c6..f2c5437de08 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ProbesMetric.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ProbesMetric.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ProbesMetric: Codable, JSONEncodable, Hashable { /// Timestamp in [Unix epoch time](https://wikipedia.org/wiki/Unix_time) in milliseconds. diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Server.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Server.swift index 00845246c6c..e034d01e9f1 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Server.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Server.swift @@ -1,14 +1,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct Server: Codable, JSONEncodable, Hashable { /// Server name. public var name: String? - public var region: Region? + public var region: MonitoringRegion? /// Included to support legacy applications. Do not rely on this attribute being present in the response. Use /// `is_replica` instead. @available(*, deprecated, message: "This property is deprecated.") @@ -22,7 +23,7 @@ public struct Server: Codable, JSONEncodable, Hashable { public init( name: String? = nil, - region: Region? = nil, + region: MonitoringRegion? = nil, isSlave: Bool? = nil, isReplica: Bool? = nil, cluster: String? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ServerStatus.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ServerStatus.swift index 4ab87b9cfa7..f03c343271d 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ServerStatus.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/ServerStatus.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum ServerStatus: String, Codable, CaseIterable { case production = "PRODUCTION" diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Status.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Status.swift index 8dcd6db5462..956857dfae6 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Status.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/Status.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Status of the cluster. public enum Status: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/StatusResponse.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/StatusResponse.swift index 825b2b91466..496121c5a41 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/StatusResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/StatusResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct StatusResponse: Codable, JSONEncodable, Hashable { public var status: [String: Status]? diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/TimeInner.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/TimeInner.swift index 72482f9266e..1dd999c86c0 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Models/TimeInner.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/Models/TimeInner.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TimeInner: Codable, JSONEncodable, Hashable { /// Timestamp in [Unix epoch time](https://wikipedia.org/wiki/Unix_time) in milliseconds. diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClient.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClient.swift index eade52757a0..512319e61f0 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClient.swift @@ -1,31 +1,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation - -typealias Client = MonitoringClient +#if canImport(Core) + import Core +#endif open class MonitoringClient { - private var configuration: Configuration + private var configuration: MonitoringClientConfiguration private var transporter: Transporter var appID: String { self.configuration.appID } - public init(configuration: Configuration, transporter: Transporter) { + public init(configuration: MonitoringClientConfiguration, transporter: Transporter) { self.configuration = configuration self.transporter = transporter } - public convenience init(configuration: Configuration) { + public convenience init(configuration: MonitoringClientConfiguration) { self.init(configuration: configuration, transporter: Transporter(configuration: configuration)) } public convenience init(appID: String, apiKey: String) throws { - try self.init(configuration: Configuration(appID: appID, apiKey: apiKey)) + try self.init(configuration: MonitoringClientConfiguration(appID: appID, apiKey: apiKey)) } /// - parameter path: (path) Path of the endpoint, anything after \"/1\" must be specified. @@ -76,7 +75,7 @@ open class MonitoringClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -138,7 +137,7 @@ open class MonitoringClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -206,7 +205,7 @@ open class MonitoringClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -274,7 +273,7 @@ open class MonitoringClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil diff --git a/clients/algoliasearch-client-swift/Sources/Monitoring/Configuration.swift b/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClientConfiguration.swift similarity index 93% rename from clients/algoliasearch-client-swift/Sources/Monitoring/Configuration.swift rename to clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClientConfiguration.swift index 56ac9ac98b0..c53e50e5c8a 100644 --- a/clients/algoliasearch-client-swift/Sources/Monitoring/Configuration.swift +++ b/clients/algoliasearch-client-swift/Sources/Monitoring/MonitoringClientConfiguration.swift @@ -1,13 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -typealias MonitoringClientConfiguration = Configuration - -public struct Configuration: Core.Configuration, Credentials { +public struct MonitoringClientConfiguration: BaseConfiguration, Credentials { public let appID: String public let apiKey: String public var writeTimeout: TimeInterval diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/Models/DeleteUserProfileResponse.swift b/clients/algoliasearch-client-swift/Sources/Personalization/Models/DeleteUserProfileResponse.swift index 73d98be309f..101d1b56b0d 100644 --- a/clients/algoliasearch-client-swift/Sources/Personalization/Models/DeleteUserProfileResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Personalization/Models/DeleteUserProfileResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct DeleteUserProfileResponse: Codable, JSONEncodable, Hashable { /// userToken representing the user for which to fetch the Personalization profile. diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/Models/ErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Personalization/Models/ErrorBase.swift deleted file mode 100644 index 29817fdeb5c..00000000000 --- a/clients/algoliasearch-client-swift/Sources/Personalization/Models/ErrorBase.swift +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -/// Error. -public struct ErrorBase: Codable, JSONEncodable, Hashable { - public var message: String? - - public init(message: String? = nil) { - self.message = message - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case message - } - - public var additionalProperties: [String: AnyCodable] = [:] - - public subscript(key: String) -> AnyCodable? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - self.additionalProperties[key] = newValue - } - } - - public init(from dictionary: [String: AnyCodable]) throws { - self.message = dictionary["message"]?.value as? String - - for (key, value) in dictionary { - switch key { - case "message": - continue - default: - self.additionalProperties[key] = value - } - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(self.message, forKey: .message) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(self.additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - self.message = try container.decodeIfPresent(String.self, forKey: .message) - var nonAdditionalPropertyKeys = Set() - nonAdditionalPropertyKeys.insert("message") - let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) - self.additionalProperties = try additionalPropertiesContainer.decodeMap( - AnyCodable.self, - excludedKeys: nonAdditionalPropertyKeys - ) - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/Models/EventScoring.swift b/clients/algoliasearch-client-swift/Sources/Personalization/Models/EventScoring.swift index 5836cb56b77..62a7ec399d1 100644 --- a/clients/algoliasearch-client-swift/Sources/Personalization/Models/EventScoring.swift +++ b/clients/algoliasearch-client-swift/Sources/Personalization/Models/EventScoring.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct EventScoring: Codable, JSONEncodable, Hashable { /// The score for the event. diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/Models/FacetScoring.swift b/clients/algoliasearch-client-swift/Sources/Personalization/Models/FacetScoring.swift index 602c0d52fc1..a7e50542c3d 100644 --- a/clients/algoliasearch-client-swift/Sources/Personalization/Models/FacetScoring.swift +++ b/clients/algoliasearch-client-swift/Sources/Personalization/Models/FacetScoring.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct FacetScoring: Codable, JSONEncodable, Hashable { /// The score for the event. diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/Models/GetUserTokenResponse.swift b/clients/algoliasearch-client-swift/Sources/Personalization/Models/GetUserTokenResponse.swift index e2181c4887f..be8fbd44da3 100644 --- a/clients/algoliasearch-client-swift/Sources/Personalization/Models/GetUserTokenResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Personalization/Models/GetUserTokenResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetUserTokenResponse: Codable, JSONEncodable, Hashable { /// userToken representing the user for which to fetch the Personalization profile. diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/Models/PersonalizationErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Personalization/Models/PersonalizationErrorBase.swift new file mode 100644 index 00000000000..6177e4a24f2 --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Personalization/Models/PersonalizationErrorBase.swift @@ -0,0 +1,72 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +/// Error. +public struct PersonalizationErrorBase: Codable, JSONEncodable, Hashable { + public var message: String? + + public init(message: String? = nil) { + self.message = message + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case message + } + + public var additionalProperties: [String: AnyCodable] = [:] + + public subscript(key: String) -> AnyCodable? { + get { + if let value = additionalProperties[key] { + return value + } + return nil + } + + set { + self.additionalProperties[key] = newValue + } + } + + public init(from dictionary: [String: AnyCodable]) throws { + self.message = dictionary["message"]?.value as? String + + for (key, value) in dictionary { + switch key { + case "message": + continue + default: + self.additionalProperties[key] = value + } + } + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(self.message, forKey: .message) + var additionalPropertiesContainer = encoder.container(keyedBy: String.self) + try additionalPropertiesContainer.encodeMap(self.additionalProperties) + } + + // Decodable protocol methods + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.message = try container.decodeIfPresent(String.self, forKey: .message) + var nonAdditionalPropertyKeys = Set() + nonAdditionalPropertyKeys.insert("message") + let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) + self.additionalProperties = try additionalPropertiesContainer.decodeMap( + AnyCodable.self, + excludedKeys: nonAdditionalPropertyKeys + ) + } +} diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/Models/PersonalizationStrategyParams.swift b/clients/algoliasearch-client-swift/Sources/Personalization/Models/PersonalizationStrategyParams.swift index b206de139e1..37fd1347cf6 100644 --- a/clients/algoliasearch-client-swift/Sources/Personalization/Models/PersonalizationStrategyParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Personalization/Models/PersonalizationStrategyParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct PersonalizationStrategyParams: Codable, JSONEncodable, Hashable { /// Scores associated with the events. diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/Models/SetPersonalizationStrategyResponse.swift b/clients/algoliasearch-client-swift/Sources/Personalization/Models/SetPersonalizationStrategyResponse.swift index 35e79afc5e5..7d52bf57623 100644 --- a/clients/algoliasearch-client-swift/Sources/Personalization/Models/SetPersonalizationStrategyResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Personalization/Models/SetPersonalizationStrategyResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SetPersonalizationStrategyResponse: Codable, JSONEncodable, Hashable { /// A message confirming the strategy update. diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClient.swift b/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClient.swift index 1b573f05074..b628ac55531 100644 --- a/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClient.swift @@ -1,31 +1,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation - -typealias Client = PersonalizationClient +#if canImport(Core) + import Core +#endif open class PersonalizationClient { - private var configuration: Configuration + private var configuration: PersonalizationClientConfiguration private var transporter: Transporter var appID: String { self.configuration.appID } - public init(configuration: Configuration, transporter: Transporter) { + public init(configuration: PersonalizationClientConfiguration, transporter: Transporter) { self.configuration = configuration self.transporter = transporter } - public convenience init(configuration: Configuration) { + public convenience init(configuration: PersonalizationClientConfiguration) { self.init(configuration: configuration, transporter: Transporter(configuration: configuration)) } public convenience init(appID: String, apiKey: String, region: Region) throws { - try self.init(configuration: Configuration(appID: appID, apiKey: apiKey, region: region)) + try self.init(configuration: PersonalizationClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } /// - parameter path: (path) Path of the endpoint, anything after \"/1\" must be specified. @@ -76,7 +75,7 @@ open class PersonalizationClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -138,7 +137,7 @@ open class PersonalizationClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -206,7 +205,7 @@ open class PersonalizationClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -274,7 +273,7 @@ open class PersonalizationClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil diff --git a/clients/algoliasearch-client-swift/Sources/Personalization/Configuration.swift b/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClientConfiguration.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Personalization/Configuration.swift rename to clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClientConfiguration.swift index b20c903997c..d68658d3b9e 100644 --- a/clients/algoliasearch-client-swift/Sources/Personalization/Configuration.swift +++ b/clients/algoliasearch-client-swift/Sources/Personalization/PersonalizationClientConfiguration.swift @@ -1,13 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -typealias PersonalizationClientConfiguration = Configuration - -public struct Configuration: Core.Configuration, Credentials { +public struct PersonalizationClientConfiguration: BaseConfiguration, Credentials { private let authorizedRegions: [Region] = [ Region.eu, Region.us, ] diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseQuerySuggestionsConfigurationResponse.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseQuerySuggestionsConfigurationResponse.swift index aed96738110..ff4f651968b 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseQuerySuggestionsConfigurationResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseQuerySuggestionsConfigurationResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BaseQuerySuggestionsConfigurationResponse: Codable, JSONEncodable, Hashable { /// API key used to read from your source index. diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseQuerySuggestionsConfigurationWithIndex.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseQuerySuggestionsConfigurationWithIndex.swift index 5d4faabbd56..fb967a4bb01 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseQuerySuggestionsConfigurationWithIndex.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseQuerySuggestionsConfigurationWithIndex.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BaseQuerySuggestionsConfigurationWithIndex: Codable, JSONEncodable, Hashable { /// Query Suggestions index name. diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseResponse.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseResponse.swift index 0e990b8abe7..0db07437c29 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/BaseResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BaseResponse: Codable, JSONEncodable, Hashable { /// HTTP status code. diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/ErrorBase.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/ErrorBase.swift deleted file mode 100644 index 29817fdeb5c..00000000000 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/ErrorBase.swift +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -/// Error. -public struct ErrorBase: Codable, JSONEncodable, Hashable { - public var message: String? - - public init(message: String? = nil) { - self.message = message - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case message - } - - public var additionalProperties: [String: AnyCodable] = [:] - - public subscript(key: String) -> AnyCodable? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - self.additionalProperties[key] = newValue - } - } - - public init(from dictionary: [String: AnyCodable]) throws { - self.message = dictionary["message"]?.value as? String - - for (key, value) in dictionary { - switch key { - case "message": - continue - default: - self.additionalProperties[key] = value - } - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(self.message, forKey: .message) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(self.additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - self.message = try container.decodeIfPresent(String.self, forKey: .message) - var nonAdditionalPropertyKeys = Set() - nonAdditionalPropertyKeys.insert("message") - let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) - self.additionalProperties = try additionalPropertiesContainer.decodeMap( - AnyCodable.self, - excludedKeys: nonAdditionalPropertyKeys - ) - } -} diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/Facet.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/Facet.swift index 8ab40db375b..45483ee2a5a 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/Facet.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/Facet.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Facet to use as category. public struct Facet: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/GetConfigStatus200Response.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/GetConfigStatus200Response.swift index d5752ba89be..85cbc126c8f 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/GetConfigStatus200Response.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/GetConfigStatus200Response.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetConfigStatus200Response: Codable, JSONEncodable, Hashable { /// Query Suggestions index name. diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/GetLogFile200Response.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/GetLogFile200Response.swift index f011b336343..86f274d24f4 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/GetLogFile200Response.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/GetLogFile200Response.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetLogFile200Response: Codable, JSONEncodable, Hashable { /// Timestamp in [ISO-8601](https://wikipedia.org/wiki/ISO_8601) format. diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/ModelLogLevel.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/ModelLogLevel.swift index 5babbfe71d8..61c06141be7 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/ModelLogLevel.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/ModelLogLevel.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// The type of log entry. - `SKIP`. A query is skipped because it doesn't match the conditions for /// successful inclusion. For example, when a query doesn't generate enough search results. - `INFO`. An diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfiguration.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfiguration.swift index d5f87836d98..e5fef1a5a1c 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfiguration.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfiguration.swift @@ -1,15 +1,16 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Query Suggestions configuration. public struct QuerySuggestionsConfiguration: Codable, JSONEncodable, Hashable { /// Algolia indices from which to get the popular searches for query suggestions. public var sourceIndices: [SourceIndex] - public var languages: Languages? + public var languages: QuerySuggestionsLanguages? /// Patterns to exclude from query suggestions. public var exclude: [String]? /// Turn on personalized query suggestions. @@ -19,7 +20,7 @@ public struct QuerySuggestionsConfiguration: Codable, JSONEncodable, Hashable { public init( sourceIndices: [SourceIndex], - languages: Languages? = nil, + languages: QuerySuggestionsLanguages? = nil, exclude: [String]? = nil, enablePersonalization: Bool? = nil, allowSpecialCharacters: Bool? = nil diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfigurationResponse.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfigurationResponse.swift index 15a7dc54642..4a8b499476d 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfigurationResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfigurationResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct QuerySuggestionsConfigurationResponse: Codable, JSONEncodable, Hashable { /// API key used to read from your source index. @@ -16,7 +17,7 @@ public struct QuerySuggestionsConfigurationResponse: Codable, JSONEncodable, Has public var indexName: String /// Algolia indices from which to get the popular searches for query suggestions. public var sourceIndices: [SourceIndex] - public var languages: Languages? + public var languages: QuerySuggestionsLanguages? /// Patterns to exclude from query suggestions. public var exclude: [String]? /// Turn on personalized query suggestions. @@ -30,7 +31,7 @@ public struct QuerySuggestionsConfigurationResponse: Codable, JSONEncodable, Has externalIndicesAPIKey: String? = nil, indexName: String, sourceIndices: [SourceIndex], - languages: Languages? = nil, + languages: QuerySuggestionsLanguages? = nil, exclude: [String]? = nil, enablePersonalization: Bool? = nil, allowSpecialCharacters: Bool? = nil diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfigurationWithIndex.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfigurationWithIndex.swift index aa3a6839697..a0b5c59b5bc 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfigurationWithIndex.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsConfigurationWithIndex.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Query Suggestions configuration. public struct QuerySuggestionsConfigurationWithIndex: Codable, JSONEncodable, Hashable { @@ -11,7 +12,7 @@ public struct QuerySuggestionsConfigurationWithIndex: Codable, JSONEncodable, Ha public var indexName: String /// Algolia indices from which to get the popular searches for query suggestions. public var sourceIndices: [SourceIndex] - public var languages: Languages? + public var languages: QuerySuggestionsLanguages? /// Patterns to exclude from query suggestions. public var exclude: [String]? /// Turn on personalized query suggestions. @@ -22,7 +23,7 @@ public struct QuerySuggestionsConfigurationWithIndex: Codable, JSONEncodable, Ha public init( indexName: String, sourceIndices: [SourceIndex], - languages: Languages? = nil, + languages: QuerySuggestionsLanguages? = nil, exclude: [String]? = nil, enablePersonalization: Bool? = nil, allowSpecialCharacters: Bool? = nil diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsErrorBase.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsErrorBase.swift new file mode 100644 index 00000000000..837c396b75e --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsErrorBase.swift @@ -0,0 +1,72 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +/// Error. +public struct QuerySuggestionsErrorBase: Codable, JSONEncodable, Hashable { + public var message: String? + + public init(message: String? = nil) { + self.message = message + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case message + } + + public var additionalProperties: [String: AnyCodable] = [:] + + public subscript(key: String) -> AnyCodable? { + get { + if let value = additionalProperties[key] { + return value + } + return nil + } + + set { + self.additionalProperties[key] = newValue + } + } + + public init(from dictionary: [String: AnyCodable]) throws { + self.message = dictionary["message"]?.value as? String + + for (key, value) in dictionary { + switch key { + case "message": + continue + default: + self.additionalProperties[key] = value + } + } + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(self.message, forKey: .message) + var additionalPropertiesContainer = encoder.container(keyedBy: String.self) + try additionalPropertiesContainer.encodeMap(self.additionalProperties) + } + + // Decodable protocol methods + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.message = try container.decodeIfPresent(String.self, forKey: .message) + var nonAdditionalPropertyKeys = Set() + nonAdditionalPropertyKeys.insert("message") + let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) + self.additionalProperties = try additionalPropertiesContainer.decodeMap( + AnyCodable.self, + excludedKeys: nonAdditionalPropertyKeys + ) + } +} diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/Languages.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsLanguages.swift similarity index 80% rename from clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/Languages.swift rename to clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsLanguages.swift index 74da0c06f4e..fe4181c9bc1 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/Languages.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsLanguages.swift @@ -1,13 +1,14 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Set the language for deduplicating singular and plural suggestions. If specified, only the more popular form is /// included. -public enum Languages: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum QuerySuggestionsLanguages: Codable, JSONEncodable, AbstractEncodable, Hashable { case bool(Bool) case arrayOfString([String]) @@ -30,7 +31,10 @@ public enum Languages: Codable, JSONEncodable, AbstractEncodable, Hashable { } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of Languages") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of QuerySuggestionsLanguages" + ) ) } } diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/SourceIndex.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/SourceIndex.swift index b1c5837dfed..d80d8c31ffa 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/SourceIndex.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/SourceIndex.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Configuration of an Algolia index for Query Suggestions. public struct SourceIndex: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClient.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClient.swift index 1b6a1f63ec3..67029ff19a0 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClient.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClient.swift @@ -1,31 +1,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation - -typealias Client = QuerySuggestionsClient +#if canImport(Core) + import Core +#endif open class QuerySuggestionsClient { - private var configuration: Configuration + private var configuration: QuerySuggestionsClientConfiguration private var transporter: Transporter var appID: String { self.configuration.appID } - public init(configuration: Configuration, transporter: Transporter) { + public init(configuration: QuerySuggestionsClientConfiguration, transporter: Transporter) { self.configuration = configuration self.transporter = transporter } - public convenience init(configuration: Configuration) { + public convenience init(configuration: QuerySuggestionsClientConfiguration) { self.init(configuration: configuration, transporter: Transporter(configuration: configuration)) } public convenience init(appID: String, apiKey: String, region: Region) throws { - try self.init(configuration: Configuration(appID: appID, apiKey: apiKey, region: region)) + try self.init(configuration: QuerySuggestionsClientConfiguration(appID: appID, apiKey: apiKey, region: region)) } /// - parameter querySuggestionsConfigurationWithIndex: (body) @@ -122,7 +121,7 @@ open class QuerySuggestionsClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -184,7 +183,7 @@ open class QuerySuggestionsClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -252,7 +251,7 @@ open class QuerySuggestionsClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -320,7 +319,7 @@ open class QuerySuggestionsClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -607,17 +606,17 @@ open class QuerySuggestionsClient { } /// - parameter indexName: (path) Query Suggestions index name. - /// - parameter querySuggestionsConfiguration: (body) + /// - parameter configuration: (body) /// - returns: BaseResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func updateConfig( indexName: String, - querySuggestionsConfiguration: QuerySuggestionsConfiguration, + configuration: QuerySuggestionsConfiguration, requestOptions: RequestOptions? = nil ) async throws -> BaseResponse { let response: Response = try await updateConfigWithHTTPInfo( indexName: indexName, - querySuggestionsConfiguration: querySuggestionsConfiguration, + configuration: configuration, requestOptions: requestOptions ) @@ -634,12 +633,12 @@ open class QuerySuggestionsClient { // // - parameter indexName: (path) Query Suggestions index name. // - // - parameter querySuggestionsConfiguration: (body) + // - parameter configuration: (body) // - returns: RequestBuilder open func updateConfigWithHTTPInfo( indexName: String, - querySuggestionsConfiguration: QuerySuggestionsConfiguration, + configuration: QuerySuggestionsConfiguration, requestOptions userRequestOptions: RequestOptions? = nil ) async throws -> Response { guard !indexName.isEmpty else { @@ -656,7 +655,7 @@ open class QuerySuggestionsClient { options: .literal, range: nil ) - let body = querySuggestionsConfiguration + let body = configuration let queryParameters: [String: Any?]? = nil let nillableHeaders: [String: Any?]? = nil diff --git a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Configuration.swift b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClientConfiguration.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/QuerySuggestions/Configuration.swift rename to clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClientConfiguration.swift index 52024eef9ed..843250e784e 100644 --- a/clients/algoliasearch-client-swift/Sources/QuerySuggestions/Configuration.swift +++ b/clients/algoliasearch-client-swift/Sources/QuerySuggestions/QuerySuggestionsClientConfiguration.swift @@ -1,13 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -typealias QuerySuggestionsClientConfiguration = Configuration - -public struct Configuration: Core.Configuration, Credentials { +public struct QuerySuggestionsClientConfiguration: BaseConfiguration, Credentials { private let authorizedRegions: [Region] = [ Region.eu, Region.us, ] diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendRequest.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendRequest.swift index a83db1a4b95..e3a6f157a68 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendRequest.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendRequest.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BaseRecommendRequest: Codable, JSONEncodable, Hashable { static let thresholdRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendationsQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendationsQuery.swift index 9e8fbe0a781..5c25626d7bc 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendationsQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendationsQuery.swift @@ -1,22 +1,23 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BaseRecommendationsQuery: Codable, JSONEncodable, Hashable { public var model: RecommendationModels /// Unique record identifier. public var objectID: String - public var queryParameters: SearchParamsObject? - public var fallbackParameters: SearchParamsObject? + public var queryParameters: RecommendSearchParamsObject? + public var fallbackParameters: RecommendSearchParamsObject? public init( model: RecommendationModels, objectID: String, - queryParameters: SearchParamsObject? = nil, - fallbackParameters: SearchParamsObject? = nil + queryParameters: RecommendSearchParamsObject? = nil, + fallbackParameters: RecommendSearchParamsObject? = nil ) { self.model = model self.objectID = objectID diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendedForYouQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendedForYouQuery.swift index c8c83995f77..6e035f0b5e8 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendedForYouQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendedForYouQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BaseRecommendedForYouQuery: Codable, JSONEncodable, Hashable { public var model: RecommendedForYouModel diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendedForYouQueryParameters.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendedForYouQueryParameters.swift index d31c9c6bc73..20024eb327d 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendedForYouQueryParameters.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseRecommendedForYouQueryParameters.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BaseRecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable { /// Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseTrendingFacetsQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseTrendingFacetsQuery.swift index 822a1017d82..196622962f6 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseTrendingFacetsQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseTrendingFacetsQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BaseTrendingFacetsQuery: Codable, JSONEncodable, Hashable { /// Facet name for trending models. diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseTrendingItemsQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseTrendingItemsQuery.swift index 625ea6defb3..401dad72a1b 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseTrendingItemsQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseTrendingItemsQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BaseTrendingItemsQuery: Codable, JSONEncodable, Hashable { /// Facet name for trending models. @@ -11,15 +12,15 @@ public struct BaseTrendingItemsQuery: Codable, JSONEncodable, Hashable { /// Facet value for trending models. public var facetValue: String? public var model: TrendingItemsModel? - public var queryParameters: SearchParamsObject? - public var fallbackParameters: SearchParamsObject? + public var queryParameters: RecommendSearchParamsObject? + public var fallbackParameters: RecommendSearchParamsObject? public init( facetName: String? = nil, facetValue: String? = nil, model: TrendingItemsModel? = nil, - queryParameters: SearchParamsObject? = nil, - fallbackParameters: SearchParamsObject? = nil + queryParameters: RecommendSearchParamsObject? = nil, + fallbackParameters: RecommendSearchParamsObject? = nil ) { self.facetName = facetName self.facetValue = facetValue diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/ErrorBase.swift deleted file mode 100644 index 29817fdeb5c..00000000000 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ErrorBase.swift +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -/// Error. -public struct ErrorBase: Codable, JSONEncodable, Hashable { - public var message: String? - - public init(message: String? = nil) { - self.message = message - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case message - } - - public var additionalProperties: [String: AnyCodable] = [:] - - public subscript(key: String) -> AnyCodable? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - self.additionalProperties[key] = newValue - } - } - - public init(from dictionary: [String: AnyCodable]) throws { - self.message = dictionary["message"]?.value as? String - - for (key, value) in dictionary { - switch key { - case "message": - continue - default: - self.additionalProperties[key] = value - } - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(self.message, forKey: .message) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(self.additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - self.message = try container.decodeIfPresent(String.self, forKey: .message) - var nonAdditionalPropertyKeys = Set() - nonAdditionalPropertyKeys.insert("message") - let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) - self.additionalProperties = try additionalPropertiesContainer.decodeMap( - AnyCodable.self, - excludedKeys: nonAdditionalPropertyKeys - ) - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendTaskResponse.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendTaskResponse.swift index 0c78f4caa72..923e2a21926 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendTaskResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendTaskResponse.swift @@ -1,14 +1,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetRecommendTaskResponse: Codable, JSONEncodable, Hashable { - public var status: TaskStatus + public var status: RecommendTaskStatus - public init(status: TaskStatus) { + public init(status: RecommendTaskStatus) { self.status = status } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendationsParams.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendationsParams.swift index 45f0117ba82..36680155a4e 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendationsParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendationsParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Recommend parameters. public struct GetRecommendationsParams: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendationsResponse.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendationsResponse.swift index e22040e570e..20b5d190f2c 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendationsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/GetRecommendationsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetRecommendationsResponse: Codable, JSONEncodable, Hashable { public var results: [RecommendationsResults]? diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/HighlightResult.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/HighlightResult.swift deleted file mode 100644 index 9be15ebe4eb..00000000000 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/HighlightResult.swift +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -public enum HighlightResult: Codable, JSONEncodable, AbstractEncodable, Hashable { - case highlightResultOption(HighlightResultOption) - case arrayOfHighlightResultOption([HighlightResultOption]) - case dictionaryOfStringToHighlightResultOption([String: HighlightResultOption]) - - public func encode(to encoder: Encoder) throws { - var container = encoder.singleValueContainer() - switch self { - case let .highlightResultOption(value): - try container.encode(value) - case let .arrayOfHighlightResultOption(value): - try container.encode(value) - case let .dictionaryOfStringToHighlightResultOption(value): - try container.encode(value) - } - } - - public init(from decoder: Decoder) throws { - let container = try decoder.singleValueContainer() - if let value = try? container.decode(HighlightResultOption.self) { - self = .highlightResultOption(value) - } else if let value = try? container.decode([HighlightResultOption].self) { - self = .arrayOfHighlightResultOption(value) - } else if let value = try? container.decode([String: HighlightResultOption].self) { - self = .dictionaryOfStringToHighlightResultOption(value) - } else { - throw DecodingError.typeMismatch( - Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of HighlightResult") - ) - } - } - - public func GetActualInstance() -> Encodable { - switch self { - case let .highlightResultOption(value): - value as HighlightResultOption - case let .arrayOfHighlightResultOption(value): - value as [HighlightResultOption] - case let .dictionaryOfStringToHighlightResultOption(value): - value as [String: HighlightResultOption] - } - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Promote.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/Promote.swift deleted file mode 100644 index 96e66ed1fe8..00000000000 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Promote.swift +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -public enum Promote: Codable, JSONEncodable, AbstractEncodable, Hashable { - case promoteObjectID(PromoteObjectID) - case promoteObjectIDs(PromoteObjectIDs) - - public func encode(to encoder: Encoder) throws { - var container = encoder.singleValueContainer() - switch self { - case let .promoteObjectID(value): - try container.encode(value) - case let .promoteObjectIDs(value): - try container.encode(value) - } - } - - public init(from decoder: Decoder) throws { - let container = try decoder.singleValueContainer() - if let value = try? container.decode(PromoteObjectID.self) { - self = .promoteObjectID(value) - } else if let value = try? container.decode(PromoteObjectIDs.self) { - self = .promoteObjectIDs(value) - } else { - throw DecodingError.typeMismatch( - Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of Promote") - ) - } - } - - public func GetActualInstance() -> Encodable { - switch self { - case let .promoteObjectID(value): - value as PromoteObjectID - case let .promoteObjectIDs(value): - value as PromoteObjectIDs - } - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/AdvancedSyntaxFeatures.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAdvancedSyntaxFeatures.swift similarity index 67% rename from clients/algoliasearch-client-swift/Sources/Search/Models/AdvancedSyntaxFeatures.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAdvancedSyntaxFeatures.swift index bfb6d79bf57..f0c26cfe59f 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/AdvancedSyntaxFeatures.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAdvancedSyntaxFeatures.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public enum AdvancedSyntaxFeatures: String, Codable, CaseIterable { +public enum RecommendAdvancedSyntaxFeatures: String, Codable, CaseIterable { case exactPhrase case excludeWords } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AlternativesAsExact.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAlternativesAsExact.swift similarity index 70% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/AlternativesAsExact.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAlternativesAsExact.swift index 6d69bf7efe7..ec1834cff75 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AlternativesAsExact.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAlternativesAsExact.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public enum AlternativesAsExact: String, Codable, CaseIterable { +public enum RecommendAlternativesAsExact: String, Codable, CaseIterable { case ignorePlurals case singleWordSynonym case multiWordsSynonym diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Anchoring.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAnchoring.swift similarity index 86% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Anchoring.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAnchoring.swift index d46f768e403..5668ce81567 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Anchoring.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAnchoring.swift @@ -1,15 +1,16 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Which part of the search query the pattern should match: - `startsWith`. The pattern must match the /// begginning of the query. - `endsWith`. The pattern must match the end of the query. - `is`. The /// pattern must match the query exactly. - `contains`. The pattern must match anywhere in the query. Empty /// queries are only allowed as pattern with `anchoring: is`. -public enum Anchoring: String, Codable, CaseIterable { +public enum RecommendAnchoring: String, Codable, CaseIterable { case `is` case startsWith case endsWith diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundPrecision.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundPrecision.swift similarity index 58% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundPrecision.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundPrecision.swift index 9c258f57f9e..2da9479eeaf 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundPrecision.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundPrecision.swift @@ -1,22 +1,23 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Precision of a coordinate-based search in meters to group results with similar distances. The Geo ranking criterion /// considers all matches within the same range of distances to be equal. -public enum AroundPrecision: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum RecommendAroundPrecision: Codable, JSONEncodable, AbstractEncodable, Hashable { case int(Int) - case arrayOfAroundPrecisionFromValueInner([AroundPrecisionFromValueInner]) + case arrayOfRecommendAroundPrecisionFromValueInner([RecommendAroundPrecisionFromValueInner]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .int(value): try container.encode(value) - case let .arrayOfAroundPrecisionFromValueInner(value): + case let .arrayOfRecommendAroundPrecisionFromValueInner(value): try container.encode(value) } } @@ -25,12 +26,15 @@ public enum AroundPrecision: Codable, JSONEncodable, AbstractEncodable, Hashable let container = try decoder.singleValueContainer() if let value = try? container.decode(Int.self) { self = .int(value) - } else if let value = try? container.decode([AroundPrecisionFromValueInner].self) { - self = .arrayOfAroundPrecisionFromValueInner(value) + } else if let value = try? container.decode([RecommendAroundPrecisionFromValueInner].self) { + self = .arrayOfRecommendAroundPrecisionFromValueInner(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of AroundPrecision") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendAroundPrecision" + ) ) } } @@ -39,8 +43,8 @@ public enum AroundPrecision: Codable, JSONEncodable, AbstractEncodable, Hashable switch self { case let .int(value): value as Int - case let .arrayOfAroundPrecisionFromValueInner(value): - value as [AroundPrecisionFromValueInner] + case let .arrayOfRecommendAroundPrecisionFromValueInner(value): + value as [RecommendAroundPrecisionFromValueInner] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/AroundPrecisionFromValueInner.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundPrecisionFromValueInner.swift similarity index 89% rename from clients/algoliasearch-client-swift/Sources/Search/Models/AroundPrecisionFromValueInner.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundPrecisionFromValueInner.swift index 88f915729af..27ff655368a 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/AroundPrecisionFromValueInner.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundPrecisionFromValueInner.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Range object with lower and upper values in meters to define custom ranges. -public struct AroundPrecisionFromValueInner: Codable, JSONEncodable, Hashable { +public struct RecommendAroundPrecisionFromValueInner: Codable, JSONEncodable, Hashable { /// Lower boundary of a range in meters. The Geo ranking criterion considers all records within the range to be /// equal. public var from: Int? diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundRadius.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundRadius.swift similarity index 63% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundRadius.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundRadius.swift index 0b309b75ba3..d6c42689479 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundRadius.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundRadius.swift @@ -1,48 +1,52 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Maximum radius for a search around a central location. This parameter works in combination with the /// `aroundLatLng` and `aroundLatLngViaIP` parameters. By default, the search radius is determined /// automatically from the density of hits around the central location. The search radius is small if there are many /// hits close to the central coordinates. -public enum AroundRadius: Codable, JSONEncodable, AbstractEncodable, Hashable { - case aroundRadiusAll(AroundRadiusAll) +public enum RecommendAroundRadius: Codable, JSONEncodable, AbstractEncodable, Hashable { case int(Int) + case recommendAroundRadiusAll(RecommendAroundRadiusAll) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { - case let .aroundRadiusAll(value): - try container.encode(value) case let .int(value): try container.encode(value) + case let .recommendAroundRadiusAll(value): + try container.encode(value) } } public init(from decoder: Decoder) throws { let container = try decoder.singleValueContainer() - if let value = try? container.decode(AroundRadiusAll.self) { - self = .aroundRadiusAll(value) - } else if let value = try? container.decode(Int.self) { + if let value = try? container.decode(Int.self) { self = .int(value) + } else if let value = try? container.decode(RecommendAroundRadiusAll.self) { + self = .recommendAroundRadiusAll(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of AroundRadius") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendAroundRadius" + ) ) } } public func GetActualInstance() -> Encodable { switch self { - case let .aroundRadiusAll(value): - value as AroundRadiusAll case let .int(value): value as Int + case let .recommendAroundRadiusAll(value): + value as RecommendAroundRadiusAll } } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundRadiusAll.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundRadiusAll.swift similarity index 73% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundRadiusAll.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundRadiusAll.swift index 7d6260ed8af..aa06a0e04c7 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundRadiusAll.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAroundRadiusAll.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Return all records with a valid `_geoloc` attribute. Don't filter by distance. -public enum AroundRadiusAll: String, Codable, CaseIterable { +public enum RecommendAroundRadiusAll: String, Codable, CaseIterable { case all } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AutomaticFacetFilter.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAutomaticFacetFilter.swift similarity index 92% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/AutomaticFacetFilter.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAutomaticFacetFilter.swift index c21f67fe709..d541b266180 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AutomaticFacetFilter.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAutomaticFacetFilter.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filter or optional filter to be applied to the search. -public struct AutomaticFacetFilter: Codable, JSONEncodable, Hashable { +public struct RecommendAutomaticFacetFilter: Codable, JSONEncodable, Hashable { /// Facet name to be applied as filter. The name must match placeholders in the `pattern` parameter. For example, /// with `pattern: {facet:genre}`, `automaticFacetFilters` must be `genre`. public var facet: String diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/AutomaticFacetFilters.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAutomaticFacetFilters.swift similarity index 71% rename from clients/algoliasearch-client-swift/Sources/Search/Models/AutomaticFacetFilters.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAutomaticFacetFilters.swift index 5f8f70dca59..881eb93bda3 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/AutomaticFacetFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendAutomaticFacetFilters.swift @@ -1,21 +1,22 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filter to be applied to the search. You can use this to respond to search queries that match a facet value. For /// example, if users search for \"comedy\", which matches a facet value of the \"genre\" facet, you /// can filter the results to show the top-ranked comedy movies. -public enum AutomaticFacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { - case arrayOfAutomaticFacetFilter([AutomaticFacetFilter]) +public enum RecommendAutomaticFacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { + case arrayOfRecommendAutomaticFacetFilter([RecommendAutomaticFacetFilter]) case arrayOfString([String]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { - case let .arrayOfAutomaticFacetFilter(value): + case let .arrayOfRecommendAutomaticFacetFilter(value): try container.encode(value) case let .arrayOfString(value): try container.encode(value) @@ -24,8 +25,8 @@ public enum AutomaticFacetFilters: Codable, JSONEncodable, AbstractEncodable, Ha public init(from decoder: Decoder) throws { let container = try decoder.singleValueContainer() - if let value = try? container.decode([AutomaticFacetFilter].self) { - self = .arrayOfAutomaticFacetFilter(value) + if let value = try? container.decode([RecommendAutomaticFacetFilter].self) { + self = .arrayOfRecommendAutomaticFacetFilter(value) } else if let value = try? container.decode([String].self) { self = .arrayOfString(value) } else { @@ -33,7 +34,7 @@ public enum AutomaticFacetFilters: Codable, JSONEncodable, AbstractEncodable, Ha Self.Type.self, .init( codingPath: decoder.codingPath, - debugDescription: "Unable to decode instance of AutomaticFacetFilters" + debugDescription: "Unable to decode instance of RecommendAutomaticFacetFilters" ) ) } @@ -41,8 +42,8 @@ public enum AutomaticFacetFilters: Codable, JSONEncodable, AbstractEncodable, Ha public func GetActualInstance() -> Encodable { switch self { - case let .arrayOfAutomaticFacetFilter(value): - value as [AutomaticFacetFilter] + case let .arrayOfRecommendAutomaticFacetFilter(value): + value as [RecommendAutomaticFacetFilter] case let .arrayOfString(value): value as [String] } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BaseSearchParams.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseSearchParams.swift similarity index 95% rename from clients/algoliasearch-client-swift/Sources/Search/Models/BaseSearchParams.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseSearchParams.swift index a89c4f703ae..04e9b139c27 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BaseSearchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseSearchParams.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct BaseSearchParams: Codable, JSONEncodable, Hashable { +public struct RecommendBaseSearchParams: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( minimum: 0, exclusiveMinimum: false, @@ -56,10 +57,10 @@ public struct BaseSearchParams: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: RecommendFacetFilters? + public var optionalFilters: RecommendOptionalFilters? + public var numericFilters: RecommendNumericFilters? + public var tagFilters: RecommendTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -86,8 +87,8 @@ public struct BaseSearchParams: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: RecommendAroundRadius? + public var aroundPrecision: RecommendAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -135,10 +136,10 @@ public struct BaseSearchParams: Codable, JSONEncodable, Hashable { query: String? = nil, similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: RecommendFacetFilters? = nil, + optionalFilters: RecommendOptionalFilters? = nil, + numericFilters: RecommendNumericFilters? = nil, + tagFilters: RecommendTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -148,8 +149,8 @@ public struct BaseSearchParams: Codable, JSONEncodable, Hashable { length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: RecommendAroundRadius? = nil, + aroundPrecision: RecommendAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BaseSearchParamsWithoutQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseSearchParamsWithoutQuery.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Search/Models/BaseSearchParamsWithoutQuery.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseSearchParamsWithoutQuery.swift index 8df877066c6..a777920f789 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BaseSearchParamsWithoutQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseSearchParamsWithoutQuery.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct BaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { +public struct RecommendBaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( minimum: 0, exclusiveMinimum: false, @@ -54,10 +55,10 @@ public struct BaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: RecommendFacetFilters? + public var optionalFilters: RecommendOptionalFilters? + public var numericFilters: RecommendNumericFilters? + public var tagFilters: RecommendTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -84,8 +85,8 @@ public struct BaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: RecommendAroundRadius? + public var aroundPrecision: RecommendAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -132,10 +133,10 @@ public struct BaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { public init( similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: RecommendFacetFilters? = nil, + optionalFilters: RecommendOptionalFilters? = nil, + numericFilters: RecommendNumericFilters? = nil, + tagFilters: RecommendTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -145,8 +146,8 @@ public struct BaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: RecommendAroundRadius? = nil, + aroundPrecision: RecommendAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BaseSearchResponse.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseSearchResponse.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Search/Models/BaseSearchResponse.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseSearchResponse.swift index 5013027ec0b..2994dc4330c 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BaseSearchResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendBaseSearchResponse.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { +public struct RecommendBaseSearchResponse: Codable, JSONEncodable, Hashable { static let abTestVariantIDRule = NumericRule( minimum: 1, exclusiveMinimum: false, @@ -40,7 +41,7 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Distance from a central coordinate provided by `aroundLatLng`. public var automaticRadius: String? - public var exhaustive: Exhaustive? + public var exhaustive: RecommendExhaustive? /// See the `facetsCount` field of the `exhaustive` object in the response. @available(*, deprecated, message: "This property is deprecated.") public var exhaustiveFacetsCount: Bool? @@ -53,7 +54,7 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { /// Facet counts. public var facets: [String: [String: Int]]? /// Statistics for numerical facets. - public var facetsStats: [String: FacetsStats]? + public var facetsStats: [String: RecommendFacetsStats]? /// Number of hits per page. public var hitsPerPage: Int /// Index name used for the query. @@ -80,8 +81,8 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { public var processingTimingsMS: AnyCodable? /// Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set. public var queryAfterRemoval: String? - public var redirect: Redirect? - public var renderingContent: RenderingContent? + public var redirect: RecommendRedirect? + public var renderingContent: RecommendRenderingContent? /// Time the server took to process the request, in milliseconds. public var serverTimeMS: Int? /// Host name of the server that processed the request. @@ -97,12 +98,12 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { abTestVariantID: Int? = nil, aroundLatLng: String? = nil, automaticRadius: String? = nil, - exhaustive: Exhaustive? = nil, + exhaustive: RecommendExhaustive? = nil, exhaustiveFacetsCount: Bool? = nil, exhaustiveNbHits: Bool? = nil, exhaustiveTypo: Bool? = nil, facets: [String: [String: Int]]? = nil, - facetsStats: [String: FacetsStats]? = nil, + facetsStats: [String: RecommendFacetsStats]? = nil, hitsPerPage: Int, index: String? = nil, indexUsed: String? = nil, @@ -115,8 +116,8 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { processingTimeMS: Int, processingTimingsMS: AnyCodable? = nil, queryAfterRemoval: String? = nil, - redirect: Redirect? = nil, - renderingContent: RenderingContent? = nil, + redirect: RecommendRedirect? = nil, + renderingContent: RecommendRenderingContent? = nil, serverTimeMS: Int? = nil, serverUsed: String? = nil, userData: AnyCodable? = nil, @@ -207,7 +208,7 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { self.automaticRadius = dictionary["automaticRadius"]?.value as? String - self.exhaustive = dictionary["exhaustive"]?.value as? Exhaustive + self.exhaustive = dictionary["exhaustive"]?.value as? RecommendExhaustive self.exhaustiveFacetsCount = dictionary["exhaustiveFacetsCount"]?.value as? Bool @@ -217,7 +218,7 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { self.facets = dictionary["facets"]?.value as? [String: [String: Int]] - self.facetsStats = dictionary["facetsStats"]?.value as? [String: FacetsStats] + self.facetsStats = dictionary["facetsStats"]?.value as? [String: RecommendFacetsStats] guard let hitsPerPage = dictionary["hitsPerPage"]?.value as? Int else { throw GenericError(description: "Failed to cast") @@ -253,9 +254,9 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { self.queryAfterRemoval = dictionary["queryAfterRemoval"]?.value as? String - self.redirect = dictionary["redirect"]?.value as? Redirect + self.redirect = dictionary["redirect"]?.value as? RecommendRedirect - self.renderingContent = dictionary["renderingContent"]?.value as? RenderingContent + self.renderingContent = dictionary["renderingContent"]?.value as? RecommendRenderingContent self.serverTimeMS = dictionary["serverTimeMS"]?.value as? Int @@ -324,12 +325,12 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { self.abTestVariantID = try container.decodeIfPresent(Int.self, forKey: .abTestVariantID) self.aroundLatLng = try container.decodeIfPresent(String.self, forKey: .aroundLatLng) self.automaticRadius = try container.decodeIfPresent(String.self, forKey: .automaticRadius) - self.exhaustive = try container.decodeIfPresent(Exhaustive.self, forKey: .exhaustive) + self.exhaustive = try container.decodeIfPresent(RecommendExhaustive.self, forKey: .exhaustive) self.exhaustiveFacetsCount = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveFacetsCount) self.exhaustiveNbHits = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveNbHits) self.exhaustiveTypo = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveTypo) self.facets = try container.decodeIfPresent([String: [String: Int]].self, forKey: .facets) - self.facetsStats = try container.decodeIfPresent([String: FacetsStats].self, forKey: .facetsStats) + self.facetsStats = try container.decodeIfPresent([String: RecommendFacetsStats].self, forKey: .facetsStats) self.hitsPerPage = try container.decode(Int.self, forKey: .hitsPerPage) self.index = try container.decodeIfPresent(String.self, forKey: .index) self.indexUsed = try container.decodeIfPresent(String.self, forKey: .indexUsed) @@ -342,8 +343,8 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { self.processingTimeMS = try container.decode(Int.self, forKey: .processingTimeMS) self.processingTimingsMS = try container.decodeIfPresent(AnyCodable.self, forKey: .processingTimingsMS) self.queryAfterRemoval = try container.decodeIfPresent(String.self, forKey: .queryAfterRemoval) - self.redirect = try container.decodeIfPresent(Redirect.self, forKey: .redirect) - self.renderingContent = try container.decodeIfPresent(RenderingContent.self, forKey: .renderingContent) + self.redirect = try container.decodeIfPresent(RecommendRedirect.self, forKey: .redirect) + self.renderingContent = try container.decodeIfPresent(RecommendRenderingContent.self, forKey: .renderingContent) self.serverTimeMS = try container.decodeIfPresent(Int.self, forKey: .serverTimeMS) self.serverUsed = try container.decodeIfPresent(String.self, forKey: .serverUsed) self.userData = try container.decodeIfPresent(AnyCodable.self, forKey: .userData) diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Condition.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendCondition.swift similarity index 92% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Condition.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendCondition.swift index d0a88e38381..8c025a002e9 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Condition.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendCondition.swift @@ -1,18 +1,19 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct Condition: Codable, JSONEncodable, Hashable { +public struct RecommendCondition: Codable, JSONEncodable, Hashable { static let contextRule = StringRule(minLength: nil, maxLength: nil, pattern: "[A-Za-z0-9_-]+") /// Query pattern that triggers the rule. You can use either a literal string, or a special pattern /// `{facet:ATTRIBUTE}`, where `ATTRIBUTE` is a facet name. The rule is triggered if the query matches the literal /// string or a value of the specified facet. For example, with `pattern: {facet:genre}`, the rule is triggered when /// users search for a genre, such as \"comedy\". public var pattern: String? - public var anchoring: Anchoring? + public var anchoring: RecommendAnchoring? /// Whether the pattern should match plurals, synonyms, and typos. public var alternatives: Bool? /// An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` @@ -26,7 +27,7 @@ public struct Condition: Codable, JSONEncodable, Hashable { public init( pattern: String? = nil, - anchoring: Anchoring? = nil, + anchoring: RecommendAnchoring? = nil, alternatives: Bool? = nil, context: String? = nil, filters: String? = nil diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Consequence.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequence.swift similarity index 84% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Consequence.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequence.swift index 999c94ed4be..dc076a0c489 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Consequence.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequence.swift @@ -1,32 +1,33 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Effect of the rule. For more information, see /// [Consequences](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#consequences). -public struct Consequence: Codable, JSONEncodable, Hashable { - public var params: ConsequenceParams? +public struct RecommendConsequence: Codable, JSONEncodable, Hashable { + public var params: RecommendConsequenceParams? /// Records you want to pin to a specific position in the search results. You can promote up to 300 records, either /// individually, or as groups of up to 100 records each. - public var promote: [Promote]? + public var promote: [RecommendPromote]? /// Whether promoted records must match an active filter for the consequence to be applied. This ensures that user /// actions (filtering the search) are given a higher precendence. For example, if you promote a record with the /// `color: red` attribute, and the user filters the search for `color: blue`, the \"red\" record won't be shown. public var filterPromotes: Bool? /// Records you want to hide from the search results. - public var hide: [ConsequenceHide]? + public var hide: [RecommendConsequenceHide]? /// A JSON object with custom data that will be appended to the `userData` array in the response. This object isn't /// interpreted by the API and is limited to 1 kB of minified JSON. public var userData: AnyCodable? public init( - params: ConsequenceParams? = nil, - promote: [Promote]? = nil, + params: RecommendConsequenceParams? = nil, + promote: [RecommendPromote]? = nil, filterPromotes: Bool? = nil, - hide: [ConsequenceHide]? = nil, + hide: [RecommendConsequenceHide]? = nil, userData: AnyCodable? = nil ) { self.params = params diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceHide.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceHide.swift similarity index 85% rename from clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceHide.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceHide.swift index 96f9cec0eff..468812f86e7 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceHide.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceHide.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Object ID of the record to hide. -public struct ConsequenceHide: Codable, JSONEncodable, Hashable { +public struct RecommendConsequenceHide: Codable, JSONEncodable, Hashable { /// Unique record identifier. public var objectID: String diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceParams.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceParams.swift similarity index 93% rename from clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceParams.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceParams.swift index e030b0b76bc..40bc374bf63 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceParams.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct ConsequenceParams: Codable, JSONEncodable, Hashable { +public struct RecommendConsequenceParams: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( minimum: 0, exclusiveMinimum: false, @@ -82,10 +83,10 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: RecommendFacetFilters? + public var optionalFilters: RecommendOptionalFilters? + public var numericFilters: RecommendNumericFilters? + public var tagFilters: RecommendTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -112,8 +113,8 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: RecommendAroundRadius? + public var aroundPrecision: RecommendAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -211,7 +212,7 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { public var minWordSizefor1Typo: Int? /// Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). public var minWordSizefor2Typos: Int? - public var typoTolerance: TypoTolerance? + public var typoTolerance: RecommendTypoTolerance? /// Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant /// matches when searching in large sets of similar numbers. public var allowTyposOnNumericTokens: Bool? @@ -222,8 +223,8 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { /// of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding /// synonyms if your attributes have intentional unusual spellings that might look like typos. public var disableTypoToleranceOnAttributes: [String]? - public var ignorePlurals: IgnorePlurals? - public var removeStopWords: RemoveStopWords? + public var ignorePlurals: RecommendIgnorePlurals? + public var removeStopWords: RecommendRemoveStopWords? /// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For /// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep /// their diacritics. @@ -244,10 +245,10 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { public var enableRules: Bool? /// Whether to enable Personalization. public var enablePersonalization: Bool? - public var queryType: QueryType? - public var removeWordsIfNoResults: RemoveWordsIfNoResults? - public var mode: Mode? - public var semanticSearch: SemanticSearch? + public var queryType: RecommendQueryType? + public var removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? + public var mode: RecommendMode? + public var semanticSearch: RecommendSemanticSearch? /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? @@ -269,20 +270,20 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { /// product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on /// other attributes. This reduces the impact of individual attributes with a lot of content on ranking. public var disableExactOnAttributes: [String]? - public var exactOnSingleWordQuery: ExactOnSingleWordQuery? + public var exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? /// Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
///
ignorePlurals
Plurals and similar declensions added by the `ignorePlurals` setting /// are considered exact matches.
singleWordSynonym
Single-word synonyms, such as /// \"NY/NYC\" are considered exact matches.
multiWordsSynonym
Multi-word synonyms, /// such as \"NY/New York\" are considered exact matches.
. - public var alternativesAsExact: [AlternativesAsExact]? + public var alternativesAsExact: [RecommendAlternativesAsExact]? /// Advanced search syntax features you want to support.
exactPhrase
Phrases in /// quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact /// string \"iPhone case\".
excludeWords
Query words prefixed with a `-` must not /// occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". ///
This setting only has an effect if `advancedSyntax` is true. - public var advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? - public var distinct: Distinct? + public var advancedSyntaxFeatures: [RecommendAdvancedSyntaxFeatures]? + public var distinct: RecommendDistinct? /// Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted /// even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records /// matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are @@ -315,22 +316,22 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { /// matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching /// attribute is determined by the order in the `searchableAttributes` setting. public var attributeCriteriaComputedByMinProximity: Bool? - public var renderingContent: RenderingContent? + public var renderingContent: RecommendRenderingContent? /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. public var enableReRanking: Bool? - public var reRankingApplyFilter: ReRankingApplyFilter? - public var query: ConsequenceQuery? - public var automaticFacetFilters: AutomaticFacetFilters? - public var automaticOptionalFacetFilters: AutomaticFacetFilters? + public var reRankingApplyFilter: RecommendReRankingApplyFilter? + public var query: RecommendConsequenceQuery? + public var automaticFacetFilters: RecommendAutomaticFacetFilters? + public var automaticOptionalFacetFilters: RecommendAutomaticFacetFilters? public init( similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: RecommendFacetFilters? = nil, + optionalFilters: RecommendOptionalFilters? = nil, + numericFilters: RecommendNumericFilters? = nil, + tagFilters: RecommendTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -340,8 +341,8 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: RecommendAroundRadius? = nil, + aroundPrecision: RecommendAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, @@ -369,27 +370,27 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { hitsPerPage: Int? = nil, minWordSizefor1Typo: Int? = nil, minWordSizefor2Typos: Int? = nil, - typoTolerance: TypoTolerance? = nil, + typoTolerance: RecommendTypoTolerance? = nil, allowTyposOnNumericTokens: Bool? = nil, disableTypoToleranceOnAttributes: [String]? = nil, - ignorePlurals: IgnorePlurals? = nil, - removeStopWords: RemoveStopWords? = nil, + ignorePlurals: RecommendIgnorePlurals? = nil, + removeStopWords: RecommendRemoveStopWords? = nil, keepDiacriticsOnCharacters: String? = nil, queryLanguages: [String]? = nil, decompoundQuery: Bool? = nil, enableRules: Bool? = nil, enablePersonalization: Bool? = nil, - queryType: QueryType? = nil, - removeWordsIfNoResults: RemoveWordsIfNoResults? = nil, - mode: Mode? = nil, - semanticSearch: SemanticSearch? = nil, + queryType: RecommendQueryType? = nil, + removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? = nil, + mode: RecommendMode? = nil, + semanticSearch: RecommendSemanticSearch? = nil, advancedSyntax: Bool? = nil, optionalWords: [String]? = nil, disableExactOnAttributes: [String]? = nil, - exactOnSingleWordQuery: ExactOnSingleWordQuery? = nil, - alternativesAsExact: [AlternativesAsExact]? = nil, - advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? = nil, - distinct: Distinct? = nil, + exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? = nil, + alternativesAsExact: [RecommendAlternativesAsExact]? = nil, + advancedSyntaxFeatures: [RecommendAdvancedSyntaxFeatures]? = nil, + distinct: RecommendDistinct? = nil, replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, @@ -397,12 +398,12 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, - renderingContent: RenderingContent? = nil, + renderingContent: RecommendRenderingContent? = nil, enableReRanking: Bool? = nil, - reRankingApplyFilter: ReRankingApplyFilter? = nil, - query: ConsequenceQuery? = nil, - automaticFacetFilters: AutomaticFacetFilters? = nil, - automaticOptionalFacetFilters: AutomaticFacetFilters? = nil + reRankingApplyFilter: RecommendReRankingApplyFilter? = nil, + query: RecommendConsequenceQuery? = nil, + automaticFacetFilters: RecommendAutomaticFacetFilters? = nil, + automaticOptionalFacetFilters: RecommendAutomaticFacetFilters? = nil ) { self.similarQuery = similarQuery self.filters = filters diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceQuery.swift similarity index 63% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceQuery.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceQuery.swift index 58b7b20d534..61d10ecd9ae 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceQuery.swift @@ -1,20 +1,21 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Replace or edit the search query. If `consequenceQuery` is a string, the entire search query is replaced /// with that string. If `consequenceQuery` is an object, it describes incremental edits made to the query. -public enum ConsequenceQuery: Codable, JSONEncodable, AbstractEncodable, Hashable { - case consequenceQueryObject(ConsequenceQueryObject) +public enum RecommendConsequenceQuery: Codable, JSONEncodable, AbstractEncodable, Hashable { + case recommendConsequenceQueryObject(RecommendConsequenceQueryObject) case string(String) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { - case let .consequenceQueryObject(value): + case let .recommendConsequenceQueryObject(value): try container.encode(value) case let .string(value): try container.encode(value) @@ -23,22 +24,25 @@ public enum ConsequenceQuery: Codable, JSONEncodable, AbstractEncodable, Hashabl public init(from decoder: Decoder) throws { let container = try decoder.singleValueContainer() - if let value = try? container.decode(ConsequenceQueryObject.self) { - self = .consequenceQueryObject(value) + if let value = try? container.decode(RecommendConsequenceQueryObject.self) { + self = .recommendConsequenceQueryObject(value) } else if let value = try? container.decode(String.self) { self = .string(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of ConsequenceQuery") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendConsequenceQuery" + ) ) } } public func GetActualInstance() -> Encodable { switch self { - case let .consequenceQueryObject(value): - value as ConsequenceQueryObject + case let .recommendConsequenceQueryObject(value): + value as RecommendConsequenceQueryObject case let .string(value): value as String } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceQueryObject.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceQueryObject.swift similarity index 77% rename from clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceQueryObject.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceQueryObject.swift index 38045d10b3a..db94890b3cd 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceQueryObject.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendConsequenceQueryObject.swift @@ -1,17 +1,18 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct ConsequenceQueryObject: Codable, JSONEncodable, Hashable { +public struct RecommendConsequenceQueryObject: Codable, JSONEncodable, Hashable { /// Words to remove from the search query. public var remove: [String]? /// Changes to make to the search query. - public var edits: [Edit]? + public var edits: [RecommendEdit]? - public init(remove: [String]? = nil, edits: [Edit]? = nil) { + public init(remove: [String]? = nil, edits: [RecommendEdit]? = nil) { self.remove = remove self.edits = edits } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/DeletedAtResponse.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendDeletedAtResponse.swift similarity index 90% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/DeletedAtResponse.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendDeletedAtResponse.swift index 5d711f2a815..b00777ed857 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/DeletedAtResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendDeletedAtResponse.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Response, taskID, and deletion timestamp. -public struct DeletedAtResponse: Codable, JSONEncodable, Hashable { +public struct RecommendDeletedAtResponse: Codable, JSONEncodable, Hashable { /// Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run /// immediately. You can check the task's progress with the [`task` operation](#tag/Indices/operation/getTask) and /// this `taskID`. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Distinct.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendDistinct.swift similarity index 84% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Distinct.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendDistinct.swift index cbf0434d55a..eb985f0c7a1 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Distinct.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendDistinct.swift @@ -1,15 +1,16 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Determines how many records of a group are included in the search results. Records with the same value for the /// `attributeForDistinct` attribute are considered a group. The `distinct` setting controls how /// many members of the group are returned. This is useful for [deduplication and grouping](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature). /// The `distinct` setting is ignored if `attributeForDistinct` is not set. -public enum Distinct: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum RecommendDistinct: Codable, JSONEncodable, AbstractEncodable, Hashable { case bool(Bool) case int(Int) @@ -32,7 +33,10 @@ public enum Distinct: Codable, JSONEncodable, AbstractEncodable, Hashable { } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of Distinct") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendDistinct" + ) ) } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Edit.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendEdit.swift similarity index 80% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Edit.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendEdit.swift index 397052f070e..cdb1fc2bad1 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Edit.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendEdit.swift @@ -1,18 +1,19 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct Edit: Codable, JSONEncodable, Hashable { - public var type: EditType? +public struct RecommendEdit: Codable, JSONEncodable, Hashable { + public var type: RecommendEditType? /// Text or patterns to remove from the query string. public var delete: String? /// Text to be added in place of the deleted text inside the query string. public var insert: String? - public init(type: EditType? = nil, delete: String? = nil, insert: String? = nil) { + public init(type: RecommendEditType? = nil, delete: String? = nil, insert: String? = nil) { self.type = type self.delete = delete self.insert = insert diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/EditType.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendEditType.swift similarity index 70% rename from clients/algoliasearch-client-swift/Sources/Search/Models/EditType.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendEditType.swift index 28ec94f9412..c0f25aff04b 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/EditType.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendEditType.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Type of edit. -public enum EditType: String, Codable, CaseIterable { +public enum RecommendEditType: String, Codable, CaseIterable { case remove case replace } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendErrorBase.swift new file mode 100644 index 00000000000..d8f10bc9095 --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendErrorBase.swift @@ -0,0 +1,72 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +/// Error. +public struct RecommendErrorBase: Codable, JSONEncodable, Hashable { + public var message: String? + + public init(message: String? = nil) { + self.message = message + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case message + } + + public var additionalProperties: [String: AnyCodable] = [:] + + public subscript(key: String) -> AnyCodable? { + get { + if let value = additionalProperties[key] { + return value + } + return nil + } + + set { + self.additionalProperties[key] = newValue + } + } + + public init(from dictionary: [String: AnyCodable]) throws { + self.message = dictionary["message"]?.value as? String + + for (key, value) in dictionary { + switch key { + case "message": + continue + default: + self.additionalProperties[key] = value + } + } + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(self.message, forKey: .message) + var additionalPropertiesContainer = encoder.container(keyedBy: String.self) + try additionalPropertiesContainer.encodeMap(self.additionalProperties) + } + + // Decodable protocol methods + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + + self.message = try container.decodeIfPresent(String.self, forKey: .message) + var nonAdditionalPropertyKeys = Set() + nonAdditionalPropertyKeys.insert("message") + let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) + self.additionalProperties = try additionalPropertiesContainer.decodeMap( + AnyCodable.self, + excludedKeys: nonAdditionalPropertyKeys + ) + } +} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ExactOnSingleWordQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendExactOnSingleWordQuery.swift similarity index 92% rename from clients/algoliasearch-client-swift/Sources/Search/Models/ExactOnSingleWordQuery.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendExactOnSingleWordQuery.swift index fcc698debe5..e1fdfcd9f33 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ExactOnSingleWordQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendExactOnSingleWordQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) /// is computed when the search query has only one word. <dl> @@ -15,7 +16,7 @@ import Foundation /// found in the attribute value. The query word must have at least 3 characters and must not be a stop word. /// </dd> </dl> If `exactOnSingleWordQuery` is `word`, only exact matches will be /// highlighted, partial and prefix matches won't. -public enum ExactOnSingleWordQuery: String, Codable, CaseIterable { +public enum RecommendExactOnSingleWordQuery: String, Codable, CaseIterable { case attribute case `none` case word diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Exhaustive.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendExhaustive.swift similarity index 96% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Exhaustive.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendExhaustive.swift index f7c16744f47..5cbb7fca1bf 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Exhaustive.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendExhaustive.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Whether certain properties of the search response are calculated exhaustive (exact) or approximated. -public struct Exhaustive: Codable, JSONEncodable, Hashable { +public struct RecommendExhaustive: Codable, JSONEncodable, Hashable { /// Whether the facet count is exhaustive (`true`) or approximate (`false`). See the [related discussion](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-). public var facetsCount: Bool? /// The value is `false` if not all facet values are retrieved. diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/FacetFilters.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacetFilters.swift similarity index 69% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/FacetFilters.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacetFilters.swift index 01e476bddd4..3fd223a3d65 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/FacetFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacetFilters.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filter the search by facet values, so that only records with the same facet values are retrieved. **Prefer using /// the `filters` parameter, which supports all filter types and combinations with boolean operators.** - @@ -11,16 +12,16 @@ import Foundation /// filter3]` is interpreted as `filter1 OR filter2 AND filter3`. - `facet:-value` is /// interpreted as `NOT facet:value`. While it's best to avoid attributes that start with a /// `-`, you can still filter them by escaping with a backslash: `facet:\\-value`. -public enum FacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum RecommendFacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) - case arrayOfMixedSearchFilters([MixedSearchFilters]) + case arrayOfRecommendMixedSearchFilters([RecommendMixedSearchFilters]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .string(value): try container.encode(value) - case let .arrayOfMixedSearchFilters(value): + case let .arrayOfRecommendMixedSearchFilters(value): try container.encode(value) } } @@ -29,12 +30,15 @@ public enum FacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { let container = try decoder.singleValueContainer() if let value = try? container.decode(String.self) { self = .string(value) - } else if let value = try? container.decode([MixedSearchFilters].self) { - self = .arrayOfMixedSearchFilters(value) + } else if let value = try? container.decode([RecommendMixedSearchFilters].self) { + self = .arrayOfRecommendMixedSearchFilters(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of FacetFilters") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendFacetFilters" + ) ) } } @@ -43,8 +47,8 @@ public enum FacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { switch self { case let .string(value): value as String - case let .arrayOfMixedSearchFilters(value): - value as [MixedSearchFilters] + case let .arrayOfRecommendMixedSearchFilters(value): + value as [RecommendMixedSearchFilters] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/FacetOrdering.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacetOrdering.swift similarity index 72% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/FacetOrdering.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacetOrdering.swift index ddea53d13e4..dac1e843297 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/FacetOrdering.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacetOrdering.swift @@ -1,17 +1,18 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Order of facet names and facet values in your UI. -public struct FacetOrdering: Codable, JSONEncodable, Hashable { - public var facets: Facets? +public struct RecommendFacetOrdering: Codable, JSONEncodable, Hashable { + public var facets: RecommendFacets? /// Order of facet values. One object for each facet. - public var values: [String: Value]? + public var values: [String: RecommendValue]? - public init(facets: Facets? = nil, values: [String: Value]? = nil) { + public init(facets: RecommendFacets? = nil, values: [String: RecommendValue]? = nil) { self.facets = facets self.values = values } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Facets.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacets.swift similarity index 88% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Facets.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacets.swift index 9a07db00c77..d6ac7bee384 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Facets.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacets.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Order of facet names. -public struct Facets: Codable, JSONEncodable, Hashable { +public struct RecommendFacets: Codable, JSONEncodable, Hashable { /// Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at /// the top of the list. public var order: [String]? diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/FacetsStats.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacetsStats.swift similarity index 91% rename from clients/algoliasearch-client-swift/Sources/Search/Models/FacetsStats.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacetsStats.swift index 19a4d749474..922813e94f6 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/FacetsStats.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendFacetsStats.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct FacetsStats: Codable, JSONEncodable, Hashable { +public struct RecommendFacetsStats: Codable, JSONEncodable, Hashable { /// Minimum value in the results. public var min: Double? /// Maximum value in the results. diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendHighlightResult.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendHighlightResult.swift new file mode 100644 index 00000000000..fbf69e39f0b --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendHighlightResult.swift @@ -0,0 +1,55 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +public enum RecommendHighlightResult: Codable, JSONEncodable, AbstractEncodable, Hashable { + case recommendHighlightResultOption(RecommendHighlightResultOption) + case arrayOfRecommendHighlightResultOption([RecommendHighlightResultOption]) + case dictionaryOfStringToRecommendHighlightResultOption([String: RecommendHighlightResultOption]) + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .recommendHighlightResultOption(value): + try container.encode(value) + case let .arrayOfRecommendHighlightResultOption(value): + try container.encode(value) + case let .dictionaryOfStringToRecommendHighlightResultOption(value): + try container.encode(value) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(RecommendHighlightResultOption.self) { + self = .recommendHighlightResultOption(value) + } else if let value = try? container.decode([RecommendHighlightResultOption].self) { + self = .arrayOfRecommendHighlightResultOption(value) + } else if let value = try? container.decode([String: RecommendHighlightResultOption].self) { + self = .dictionaryOfStringToRecommendHighlightResultOption(value) + } else { + throw DecodingError.typeMismatch( + Self.Type.self, + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendHighlightResult" + ) + ) + } + } + + public func GetActualInstance() -> Encodable { + switch self { + case let .recommendHighlightResultOption(value): + value as RecommendHighlightResultOption + case let .arrayOfRecommendHighlightResultOption(value): + value as [RecommendHighlightResultOption] + case let .dictionaryOfStringToRecommendHighlightResultOption(value): + value as [String: RecommendHighlightResultOption] + } + } +} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/HighlightResultOption.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendHighlightResultOption.swift similarity index 81% rename from clients/algoliasearch-client-swift/Sources/Search/Models/HighlightResultOption.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendHighlightResultOption.swift index 6f959bec698..eba94dc7099 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/HighlightResultOption.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendHighlightResultOption.swift @@ -1,21 +1,22 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Surround words that match the query with HTML tags for highlighting. -public struct HighlightResultOption: Codable, JSONEncodable, Hashable { +public struct RecommendHighlightResultOption: Codable, JSONEncodable, Hashable { /// Highlighted attribute value, including HTML tags. public var value: String - public var matchLevel: MatchLevel + public var matchLevel: RecommendMatchLevel /// List of matched words from the search query. public var matchedWords: [String] /// Whether the entire attribute value is highlighted. public var fullyHighlighted: Bool? - public init(value: String, matchLevel: MatchLevel, matchedWords: [String], fullyHighlighted: Bool? = nil) { + public init(value: String, matchLevel: RecommendMatchLevel, matchedWords: [String], fullyHighlighted: Bool? = nil) { self.value = value self.matchLevel = matchLevel self.matchedWords = matchedWords diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendHit.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendHit.swift index 5fe1670dab0..38c3c133c6b 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendHit.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendHit.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Recommend hit. public struct RecommendHit: Codable, JSONEncodable, Hashable { @@ -17,19 +18,19 @@ public struct RecommendHit: Codable, JSONEncodable, Hashable { /// Unique record identifier. public var objectID: String /// Surround words that match the query with HTML tags for highlighting. - public var highlightResult: [String: HighlightResult]? + public var highlightResult: [String: RecommendHighlightResult]? /// Snippets that show the context around a matching search query. - public var snippetResult: [String: SnippetResult]? - public var rankingInfo: RankingInfo? + public var snippetResult: [String: RecommendSnippetResult]? + public var rankingInfo: RecommendRankingInfo? public var distinctSeqID: Int? /// Recommendation score. public var score: Double public init( objectID: String, - highlightResult: [String: HighlightResult]? = nil, - snippetResult: [String: SnippetResult]? = nil, - rankingInfo: RankingInfo? = nil, + highlightResult: [String: RecommendHighlightResult]? = nil, + snippetResult: [String: RecommendSnippetResult]? = nil, + rankingInfo: RecommendRankingInfo? = nil, distinctSeqID: Int? = nil, score: Double ) { @@ -70,11 +71,11 @@ public struct RecommendHit: Codable, JSONEncodable, Hashable { throw GenericError(description: "Failed to cast") } self.objectID = objectID - self.highlightResult = dictionary["highlightResult"]?.value as? [String: HighlightResult] + self.highlightResult = dictionary["highlightResult"]?.value as? [String: RecommendHighlightResult] - self.snippetResult = dictionary["snippetResult"]?.value as? [String: SnippetResult] + self.snippetResult = dictionary["snippetResult"]?.value as? [String: RecommendSnippetResult] - self.rankingInfo = dictionary["rankingInfo"]?.value as? RankingInfo + self.rankingInfo = dictionary["rankingInfo"]?.value as? RecommendRankingInfo self.distinctSeqID = dictionary["distinctSeqID"]?.value as? Int @@ -112,9 +113,15 @@ public struct RecommendHit: Codable, JSONEncodable, Hashable { let container = try decoder.container(keyedBy: CodingKeys.self) self.objectID = try container.decode(String.self, forKey: .objectID) - self.highlightResult = try container.decodeIfPresent([String: HighlightResult].self, forKey: .highlightResult) - self.snippetResult = try container.decodeIfPresent([String: SnippetResult].self, forKey: .snippetResult) - self.rankingInfo = try container.decodeIfPresent(RankingInfo.self, forKey: .rankingInfo) + self.highlightResult = try container.decodeIfPresent( + [String: RecommendHighlightResult].self, + forKey: .highlightResult + ) + self.snippetResult = try container.decodeIfPresent( + [String: RecommendSnippetResult].self, + forKey: .snippetResult + ) + self.rankingInfo = try container.decodeIfPresent(RecommendRankingInfo.self, forKey: .rankingInfo) self.distinctSeqID = try container.decodeIfPresent(Int.self, forKey: .distinctSeqID) self.score = try container.decode(Double.self, forKey: .score) var nonAdditionalPropertyKeys = Set() diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/IgnorePlurals.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendIgnorePlurals.swift similarity index 81% rename from clients/algoliasearch-client-swift/Sources/Search/Models/IgnorePlurals.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendIgnorePlurals.swift index 97e842a3b47..43ecd2f8056 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/IgnorePlurals.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendIgnorePlurals.swift @@ -1,13 +1,14 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Treat singular, plurals, and other forms of declensions as equivalent. You should only use this feature for the /// languages used in your index. -public enum IgnorePlurals: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum RecommendIgnorePlurals: Codable, JSONEncodable, AbstractEncodable, Hashable { case bool(Bool) case arrayOfString([String]) @@ -30,7 +31,10 @@ public enum IgnorePlurals: Codable, JSONEncodable, AbstractEncodable, Hashable { } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of IgnorePlurals") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendIgnorePlurals" + ) ) } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/IndexSettingsAsSearchParams.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendIndexSettingsAsSearchParams.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Search/Models/IndexSettingsAsSearchParams.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendIndexSettingsAsSearchParams.swift index 651dc9ec96a..41f1def57a7 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/IndexSettingsAsSearchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendIndexSettingsAsSearchParams.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { +public struct RecommendIndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { static let hitsPerPageRule = NumericRule( minimum: 1, exclusiveMinimum: false, @@ -89,7 +90,7 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { public var minWordSizefor1Typo: Int? /// Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). public var minWordSizefor2Typos: Int? - public var typoTolerance: TypoTolerance? + public var typoTolerance: RecommendTypoTolerance? /// Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant /// matches when searching in large sets of similar numbers. public var allowTyposOnNumericTokens: Bool? @@ -100,8 +101,8 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { /// of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding /// synonyms if your attributes have intentional unusual spellings that might look like typos. public var disableTypoToleranceOnAttributes: [String]? - public var ignorePlurals: IgnorePlurals? - public var removeStopWords: RemoveStopWords? + public var ignorePlurals: RecommendIgnorePlurals? + public var removeStopWords: RecommendRemoveStopWords? /// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For /// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep /// their diacritics. @@ -122,10 +123,10 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { public var enableRules: Bool? /// Whether to enable Personalization. public var enablePersonalization: Bool? - public var queryType: QueryType? - public var removeWordsIfNoResults: RemoveWordsIfNoResults? - public var mode: Mode? - public var semanticSearch: SemanticSearch? + public var queryType: RecommendQueryType? + public var removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? + public var mode: RecommendMode? + public var semanticSearch: RecommendSemanticSearch? /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? @@ -147,20 +148,20 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { /// product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on /// other attributes. This reduces the impact of individual attributes with a lot of content on ranking. public var disableExactOnAttributes: [String]? - public var exactOnSingleWordQuery: ExactOnSingleWordQuery? + public var exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? /// Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
///
ignorePlurals
Plurals and similar declensions added by the `ignorePlurals` setting /// are considered exact matches.
singleWordSynonym
Single-word synonyms, such as /// \"NY/NYC\" are considered exact matches.
multiWordsSynonym
Multi-word synonyms, /// such as \"NY/New York\" are considered exact matches.
. - public var alternativesAsExact: [AlternativesAsExact]? + public var alternativesAsExact: [RecommendAlternativesAsExact]? /// Advanced search syntax features you want to support.
exactPhrase
Phrases in /// quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact /// string \"iPhone case\".
excludeWords
Query words prefixed with a `-` must not /// occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". ///
This setting only has an effect if `advancedSyntax` is true. - public var advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? - public var distinct: Distinct? + public var advancedSyntaxFeatures: [RecommendAdvancedSyntaxFeatures]? + public var distinct: RecommendDistinct? /// Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted /// even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records /// matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are @@ -193,11 +194,11 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { /// matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching /// attribute is determined by the order in the `searchableAttributes` setting. public var attributeCriteriaComputedByMinProximity: Bool? - public var renderingContent: RenderingContent? + public var renderingContent: RecommendRenderingContent? /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. public var enableReRanking: Bool? - public var reRankingApplyFilter: ReRankingApplyFilter? + public var reRankingApplyFilter: RecommendReRankingApplyFilter? public init( attributesToRetrieve: [String]? = nil, @@ -213,27 +214,27 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { hitsPerPage: Int? = nil, minWordSizefor1Typo: Int? = nil, minWordSizefor2Typos: Int? = nil, - typoTolerance: TypoTolerance? = nil, + typoTolerance: RecommendTypoTolerance? = nil, allowTyposOnNumericTokens: Bool? = nil, disableTypoToleranceOnAttributes: [String]? = nil, - ignorePlurals: IgnorePlurals? = nil, - removeStopWords: RemoveStopWords? = nil, + ignorePlurals: RecommendIgnorePlurals? = nil, + removeStopWords: RecommendRemoveStopWords? = nil, keepDiacriticsOnCharacters: String? = nil, queryLanguages: [String]? = nil, decompoundQuery: Bool? = nil, enableRules: Bool? = nil, enablePersonalization: Bool? = nil, - queryType: QueryType? = nil, - removeWordsIfNoResults: RemoveWordsIfNoResults? = nil, - mode: Mode? = nil, - semanticSearch: SemanticSearch? = nil, + queryType: RecommendQueryType? = nil, + removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? = nil, + mode: RecommendMode? = nil, + semanticSearch: RecommendSemanticSearch? = nil, advancedSyntax: Bool? = nil, optionalWords: [String]? = nil, disableExactOnAttributes: [String]? = nil, - exactOnSingleWordQuery: ExactOnSingleWordQuery? = nil, - alternativesAsExact: [AlternativesAsExact]? = nil, - advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? = nil, - distinct: Distinct? = nil, + exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? = nil, + alternativesAsExact: [RecommendAlternativesAsExact]? = nil, + advancedSyntaxFeatures: [RecommendAdvancedSyntaxFeatures]? = nil, + distinct: RecommendDistinct? = nil, replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, @@ -241,9 +242,9 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, - renderingContent: RenderingContent? = nil, + renderingContent: RecommendRenderingContent? = nil, enableReRanking: Bool? = nil, - reRankingApplyFilter: ReRankingApplyFilter? = nil + reRankingApplyFilter: RecommendReRankingApplyFilter? = nil ) { self.attributesToRetrieve = attributesToRetrieve self.ranking = ranking diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/MatchLevel.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMatchLevel.swift similarity index 74% rename from clients/algoliasearch-client-swift/Sources/Search/Models/MatchLevel.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMatchLevel.swift index 7b1c3fd2bae..d763a9221d2 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/MatchLevel.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMatchLevel.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Whether the whole query string matches or only a part. -public enum MatchLevel: String, Codable, CaseIterable { +public enum RecommendMatchLevel: String, Codable, CaseIterable { case `none` case partial case full diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/MatchedGeoLocation.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMatchedGeoLocation.swift similarity index 90% rename from clients/algoliasearch-client-swift/Sources/Search/Models/MatchedGeoLocation.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMatchedGeoLocation.swift index 90dc2f9505e..5f20ad9b4fa 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/MatchedGeoLocation.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMatchedGeoLocation.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct MatchedGeoLocation: Codable, JSONEncodable, Hashable { +public struct RecommendMatchedGeoLocation: Codable, JSONEncodable, Hashable { /// Latitude of the matched location. public var lat: Double? /// Longitude of the matched location. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/MixedSearchFilters.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMixedSearchFilters.swift similarity index 88% rename from clients/algoliasearch-client-swift/Sources/Search/Models/MixedSearchFilters.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMixedSearchFilters.swift index a271b711500..e465fb4c4a0 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/MixedSearchFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMixedSearchFilters.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public enum MixedSearchFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum RecommendMixedSearchFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) case arrayOfString([String]) @@ -30,7 +31,7 @@ public enum MixedSearchFilters: Codable, JSONEncodable, AbstractEncodable, Hasha Self.Type.self, .init( codingPath: decoder.codingPath, - debugDescription: "Unable to decode instance of MixedSearchFilters" + debugDescription: "Unable to decode instance of RecommendMixedSearchFilters" ) ) } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Mode.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMode.swift similarity index 79% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Mode.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMode.swift index 7b5a30f0f7e..3dd65272309 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Mode.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendMode.swift @@ -1,13 +1,14 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Search mode the index will use to query for results. This setting only applies to indices, for which Algolia /// enabled NeuralSearch for you. -public enum Mode: String, Codable, CaseIterable { +public enum RecommendMode: String, Codable, CaseIterable { case neuralSearch case keywordSearch } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendModels.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendModels.swift index 46af0fcabe2..242a9277ffe 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendModels.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendModels.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum RecommendModels: String, Codable, CaseIterable { case relatedProducts = "related-products" diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/NumericFilters.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendNumericFilters.swift similarity index 68% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/NumericFilters.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendNumericFilters.swift index 287190ad67b..d0a47b162cd 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/NumericFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendNumericFilters.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filter by numeric facets. **Prefer using the `filters` parameter, which supports all filter types and /// combinations with boolean operators.** You can use numeric comparison operators: `<`, @@ -11,16 +12,16 @@ import Foundation /// Comparsions are precise up to 3 decimals. You can also provide ranges: `facet:<lower> TO /// <upper>`. The range includes the lower and upper boundaries. The same combination rules apply as for /// `facetFilters`. -public enum NumericFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum RecommendNumericFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) - case arrayOfMixedSearchFilters([MixedSearchFilters]) + case arrayOfRecommendMixedSearchFilters([RecommendMixedSearchFilters]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .string(value): try container.encode(value) - case let .arrayOfMixedSearchFilters(value): + case let .arrayOfRecommendMixedSearchFilters(value): try container.encode(value) } } @@ -29,12 +30,15 @@ public enum NumericFilters: Codable, JSONEncodable, AbstractEncodable, Hashable let container = try decoder.singleValueContainer() if let value = try? container.decode(String.self) { self = .string(value) - } else if let value = try? container.decode([MixedSearchFilters].self) { - self = .arrayOfMixedSearchFilters(value) + } else if let value = try? container.decode([RecommendMixedSearchFilters].self) { + self = .arrayOfRecommendMixedSearchFilters(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of NumericFilters") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendNumericFilters" + ) ) } } @@ -43,8 +47,8 @@ public enum NumericFilters: Codable, JSONEncodable, AbstractEncodable, Hashable switch self { case let .string(value): value as String - case let .arrayOfMixedSearchFilters(value): - value as [MixedSearchFilters] + case let .arrayOfRecommendMixedSearchFilters(value): + value as [RecommendMixedSearchFilters] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/OptionalFilters.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendOptionalFilters.swift similarity index 67% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/OptionalFilters.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendOptionalFilters.swift index 3c02fabf5cf..64b779af2df 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/OptionalFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendOptionalFilters.swift @@ -1,25 +1,26 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filters to promote or demote records in the search results. Optional filters work like facet filters, but they /// don't exclude records from the search results. Records that match the optional filter rank before records that /// don't match. If you're using a negative filter `facet:-value`, matching records rank after records /// that don't match. - Optional filters don't work on virtual replicas. - Optional filters are applied _after_ /// sort-by attributes. - Optional filters don't work with numeric attributes. -public enum OptionalFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum RecommendOptionalFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) - case arrayOfMixedSearchFilters([MixedSearchFilters]) + case arrayOfRecommendMixedSearchFilters([RecommendMixedSearchFilters]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .string(value): try container.encode(value) - case let .arrayOfMixedSearchFilters(value): + case let .arrayOfRecommendMixedSearchFilters(value): try container.encode(value) } } @@ -28,12 +29,15 @@ public enum OptionalFilters: Codable, JSONEncodable, AbstractEncodable, Hashable let container = try decoder.singleValueContainer() if let value = try? container.decode(String.self) { self = .string(value) - } else if let value = try? container.decode([MixedSearchFilters].self) { - self = .arrayOfMixedSearchFilters(value) + } else if let value = try? container.decode([RecommendMixedSearchFilters].self) { + self = .arrayOfRecommendMixedSearchFilters(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of OptionalFilters") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendOptionalFilters" + ) ) } } @@ -42,8 +46,8 @@ public enum OptionalFilters: Codable, JSONEncodable, AbstractEncodable, Hashable switch self { case let .string(value): value as String - case let .arrayOfMixedSearchFilters(value): - value as [MixedSearchFilters] + case let .arrayOfRecommendMixedSearchFilters(value): + value as [RecommendMixedSearchFilters] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Params.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendParams.swift similarity index 68% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Params.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendParams.swift index 6d25007bfa4..2604a86de2b 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Params.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendParams.swift @@ -1,23 +1,24 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Parameters to apply to this search. You can use all search parameters, plus special /// `automaticFacetFilters`, `automaticOptionalFacetFilters`, and `query`. -public struct Params: Codable, JSONEncodable, Hashable { - public var query: ConsequenceQuery? - public var automaticFacetFilters: AutomaticFacetFilters? - public var automaticOptionalFacetFilters: AutomaticFacetFilters? - public var renderingContent: RenderingContent? +public struct RecommendParams: Codable, JSONEncodable, Hashable { + public var query: RecommendConsequenceQuery? + public var automaticFacetFilters: RecommendAutomaticFacetFilters? + public var automaticOptionalFacetFilters: RecommendAutomaticFacetFilters? + public var renderingContent: RecommendRenderingContent? public init( - query: ConsequenceQuery? = nil, - automaticFacetFilters: AutomaticFacetFilters? = nil, - automaticOptionalFacetFilters: AutomaticFacetFilters? = nil, - renderingContent: RenderingContent? = nil + query: RecommendConsequenceQuery? = nil, + automaticFacetFilters: RecommendAutomaticFacetFilters? = nil, + automaticOptionalFacetFilters: RecommendAutomaticFacetFilters? = nil, + renderingContent: RecommendRenderingContent? = nil ) { self.query = query self.automaticFacetFilters = automaticFacetFilters diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Personalization.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPersonalization.swift similarity index 90% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Personalization.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPersonalization.swift index 8c2beaf1cf7..fa5d0265d78 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Personalization.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPersonalization.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct Personalization: Codable, JSONEncodable, Hashable { +public struct RecommendPersonalization: Codable, JSONEncodable, Hashable { /// The score of the filters. public var filtersScore: Int? /// The score of the ranking. diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPromote.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPromote.swift new file mode 100644 index 00000000000..f7b6bd626c3 --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPromote.swift @@ -0,0 +1,45 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +public enum RecommendPromote: Codable, JSONEncodable, AbstractEncodable, Hashable { + case recommendPromoteObjectID(RecommendPromoteObjectID) + case recommendPromoteObjectIDs(RecommendPromoteObjectIDs) + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .recommendPromoteObjectID(value): + try container.encode(value) + case let .recommendPromoteObjectIDs(value): + try container.encode(value) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(RecommendPromoteObjectID.self) { + self = .recommendPromoteObjectID(value) + } else if let value = try? container.decode(RecommendPromoteObjectIDs.self) { + self = .recommendPromoteObjectIDs(value) + } else { + throw DecodingError.typeMismatch( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of RecommendPromote") + ) + } + } + + public func GetActualInstance() -> Encodable { + switch self { + case let .recommendPromoteObjectID(value): + value as RecommendPromoteObjectID + case let .recommendPromoteObjectIDs(value): + value as RecommendPromoteObjectIDs + } + } +} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/PromoteObjectID.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPromoteObjectID.swift similarity index 88% rename from clients/algoliasearch-client-swift/Sources/Search/Models/PromoteObjectID.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPromoteObjectID.swift index b6c75eaaa89..2749e78acaf 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/PromoteObjectID.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPromoteObjectID.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Record to promote. -public struct PromoteObjectID: Codable, JSONEncodable, Hashable { +public struct RecommendPromoteObjectID: Codable, JSONEncodable, Hashable { /// Unique record identifier. public var objectID: String /// Position in the search results where you want to show the promoted records. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/PromoteObjectIDs.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPromoteObjectIDs.swift similarity index 90% rename from clients/algoliasearch-client-swift/Sources/Search/Models/PromoteObjectIDs.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPromoteObjectIDs.swift index 8ee4febab54..d2cdc0d29cf 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/PromoteObjectIDs.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendPromoteObjectIDs.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Records to promote. -public struct PromoteObjectIDs: Codable, JSONEncodable, Hashable { +public struct RecommendPromoteObjectIDs: Codable, JSONEncodable, Hashable { /// Object IDs of the records you want to promote. The records are placed as a group at the `position`. For /// example, if you want to promote four records to position `0`, they will be the first four search results. public var objectIDs: [String] diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/QueryType.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendQueryType.swift similarity index 88% rename from clients/algoliasearch-client-swift/Sources/Search/Models/QueryType.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendQueryType.swift index 75e915dbdb1..faf4395a6e3 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/QueryType.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendQueryType.swift @@ -1,15 +1,16 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Determines if and how query words are interpreted as prefixes. By default, only the last query word is treated as /// prefix (`prefixLast`). To turn off prefix search, use `prefixNone`. Avoid `prefixAll`, /// which treats all query words as prefixes. This might lead to counterintuitive results and makes your search slower. /// For more information, see [Prefix searching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching/). -public enum QueryType: String, Codable, CaseIterable { +public enum RecommendQueryType: String, Codable, CaseIterable { case prefixLast case prefixAll case prefixNone diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/RankingInfo.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRankingInfo.swift similarity index 93% rename from clients/algoliasearch-client-swift/Sources/Search/Models/RankingInfo.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRankingInfo.swift index a5eea03ca68..1d630717c9d 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/RankingInfo.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRankingInfo.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Object with detailed information about the record's ranking. -public struct RankingInfo: Codable, JSONEncodable, Hashable { +public struct RecommendRankingInfo: Codable, JSONEncodable, Hashable { static let filtersRule = NumericRule( minimum: 0, exclusiveMinimum: false, @@ -72,8 +73,8 @@ public struct RankingInfo: Codable, JSONEncodable, Hashable { public var geoDistance: Int /// Precision used when computing the geo distance, in meters. public var geoPrecision: Int? - public var matchedGeoLocation: MatchedGeoLocation? - public var personalization: Personalization? + public var matchedGeoLocation: RecommendMatchedGeoLocation? + public var personalization: RecommendPersonalization? /// Number of exactly matched words. public var nbExactWords: Int /// Number of typos encountered when matching the record. @@ -94,8 +95,8 @@ public struct RankingInfo: Codable, JSONEncodable, Hashable { firstMatchedWord: Int, geoDistance: Int, geoPrecision: Int? = nil, - matchedGeoLocation: MatchedGeoLocation? = nil, - personalization: Personalization? = nil, + matchedGeoLocation: RecommendMatchedGeoLocation? = nil, + personalization: RecommendPersonalization? = nil, nbExactWords: Int, nbTypos: Int, promoted: Bool, diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ReRankingApplyFilter.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendReRankingApplyFilter.swift similarity index 68% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/ReRankingApplyFilter.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendReRankingApplyFilter.swift index ce14641b152..ed61e636599 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ReRankingApplyFilter.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendReRankingApplyFilter.swift @@ -1,22 +1,23 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Restrict [Dynamic Re-ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) to records that match these /// filters. -public enum ReRankingApplyFilter: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum RecommendReRankingApplyFilter: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) - case arrayOfMixedSearchFilters([MixedSearchFilters]) + case arrayOfRecommendMixedSearchFilters([RecommendMixedSearchFilters]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .string(value): try container.encode(value) - case let .arrayOfMixedSearchFilters(value): + case let .arrayOfRecommendMixedSearchFilters(value): try container.encode(value) } } @@ -25,14 +26,14 @@ public enum ReRankingApplyFilter: Codable, JSONEncodable, AbstractEncodable, Has let container = try decoder.singleValueContainer() if let value = try? container.decode(String.self) { self = .string(value) - } else if let value = try? container.decode([MixedSearchFilters].self) { - self = .arrayOfMixedSearchFilters(value) + } else if let value = try? container.decode([RecommendMixedSearchFilters].self) { + self = .arrayOfRecommendMixedSearchFilters(value) } else { throw DecodingError.typeMismatch( Self.Type.self, .init( codingPath: decoder.codingPath, - debugDescription: "Unable to decode instance of ReRankingApplyFilter" + debugDescription: "Unable to decode instance of RecommendReRankingApplyFilter" ) ) } @@ -42,8 +43,8 @@ public enum ReRankingApplyFilter: Codable, JSONEncodable, AbstractEncodable, Has switch self { case let .string(value): value as String - case let .arrayOfMixedSearchFilters(value): - value as [MixedSearchFilters] + case let .arrayOfRecommendMixedSearchFilters(value): + value as [RecommendMixedSearchFilters] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Redirect.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRedirect.swift similarity index 74% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Redirect.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRedirect.swift index 37f614103de..3ad992ea0d9 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Redirect.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRedirect.swift @@ -1,16 +1,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// [Redirect results to a /// URL](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/redirects/). -public struct Redirect: Codable, JSONEncodable, Hashable { - public var index: [RedirectRuleIndexMetadata]? +public struct RecommendRedirect: Codable, JSONEncodable, Hashable { + public var index: [RecommendRedirectRuleIndexMetadata]? - public init(index: [RedirectRuleIndexMetadata]? = nil) { + public init(index: [RecommendRedirectRuleIndexMetadata]? = nil) { self.index = index } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/RedirectRuleIndexMetadata.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRedirectRuleIndexMetadata.swift similarity index 77% rename from clients/algoliasearch-client-swift/Sources/Search/Models/RedirectRuleIndexMetadata.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRedirectRuleIndexMetadata.swift index a42a154696d..b0a5b20be3f 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/RedirectRuleIndexMetadata.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRedirectRuleIndexMetadata.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct RedirectRuleIndexMetadata: Codable, JSONEncodable, Hashable { +public struct RecommendRedirectRuleIndexMetadata: Codable, JSONEncodable, Hashable { /// Source index for the redirect rule. public var source: String /// Destination index for the redirect rule. @@ -14,9 +15,15 @@ public struct RedirectRuleIndexMetadata: Codable, JSONEncodable, Hashable { public var reason: String /// Redirect rule status. public var succeed: Bool - public var data: RedirectRuleIndexMetadataData + public var data: RecommendRedirectRuleIndexMetadataData - public init(source: String, dest: String, reason: String, succeed: Bool, data: RedirectRuleIndexMetadataData) { + public init( + source: String, + dest: String, + reason: String, + succeed: Bool, + data: RecommendRedirectRuleIndexMetadataData + ) { self.source = source self.dest = dest self.reason = reason diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RedirectRuleIndexMetadataData.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRedirectRuleIndexMetadataData.swift similarity index 83% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/RedirectRuleIndexMetadataData.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRedirectRuleIndexMetadataData.swift index 358dd692ec4..d20ef11fd68 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RedirectRuleIndexMetadataData.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRedirectRuleIndexMetadataData.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Redirect rule data. -public struct RedirectRuleIndexMetadataData: Codable, JSONEncodable, Hashable { +public struct RecommendRedirectRuleIndexMetadataData: Codable, JSONEncodable, Hashable { public var ruleObjectID: String public init(ruleObjectID: String) { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/RemoveStopWords.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRemoveStopWords.swift similarity index 82% rename from clients/algoliasearch-client-swift/Sources/Search/Models/RemoveStopWords.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRemoveStopWords.swift index d3aa055ea45..b6170f7e2ce 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/RemoveStopWords.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRemoveStopWords.swift @@ -1,14 +1,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Removes stop words from the search query. Stop words are common words like articles, conjunctions, prepositions, or /// pronouns that have little or no meaning on their own. In English, \"the\", \"a\", or /// \"and\" are stop words. You should only use this feature for the languages used in your index. -public enum RemoveStopWords: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum RecommendRemoveStopWords: Codable, JSONEncodable, AbstractEncodable, Hashable { case bool(Bool) case arrayOfString([String]) @@ -31,7 +32,10 @@ public enum RemoveStopWords: Codable, JSONEncodable, AbstractEncodable, Hashable } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of RemoveStopWords") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendRemoveStopWords" + ) ) } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/RemoveWordsIfNoResults.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRemoveWordsIfNoResults.swift similarity index 91% rename from clients/algoliasearch-client-swift/Sources/Search/Models/RemoveWordsIfNoResults.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRemoveWordsIfNoResults.swift index 5142b14d0df..55a646b0681 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/RemoveWordsIfNoResults.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRemoveWordsIfNoResults.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Strategy for removing words from the query when it doesn't return any results. This helps to avoid returning /// empty search results. <dl> <dt><code>none</code></dt> <dd>No words are removed @@ -13,7 +14,7 @@ import Foundation /// the first (then second, then third) word as optional, until there are results or at most 5 words have been /// removed.</dd> <dt><code>allOptional</code></dt> <dd>Treat all words as /// optional.</dd> </dl> For more information, see [Remove words to improve results](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results/). -public enum RemoveWordsIfNoResults: String, Codable, CaseIterable { +public enum RecommendRemoveWordsIfNoResults: String, Codable, CaseIterable { case `none` case lastWords case firstWords diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/RenderingContent.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRenderingContent.swift similarity index 76% rename from clients/algoliasearch-client-swift/Sources/Search/Models/RenderingContent.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRenderingContent.swift index b1b448340a0..6da65d8f28c 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/RenderingContent.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendRenderingContent.swift @@ -1,16 +1,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as, the /// order of facet names and values without changing your frontend code. -public struct RenderingContent: Codable, JSONEncodable, Hashable { - public var facetOrdering: FacetOrdering? +public struct RecommendRenderingContent: Codable, JSONEncodable, Hashable { + public var facetOrdering: RecommendFacetOrdering? - public init(facetOrdering: FacetOrdering? = nil) { + public init(facetOrdering: RecommendFacetOrdering? = nil) { self.facetOrdering = facetOrdering } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchParamsObject.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSearchParamsObject.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchParamsObject.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSearchParamsObject.swift index b3e43a537d6..f48b0c0a762 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchParamsObject.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSearchParamsObject.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct SearchParamsObject: Codable, JSONEncodable, Hashable { +public struct RecommendSearchParamsObject: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( minimum: 0, exclusiveMinimum: false, @@ -84,10 +85,10 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: RecommendFacetFilters? + public var optionalFilters: RecommendOptionalFilters? + public var numericFilters: RecommendNumericFilters? + public var tagFilters: RecommendTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -114,8 +115,8 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: RecommendAroundRadius? + public var aroundPrecision: RecommendAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -213,7 +214,7 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { public var minWordSizefor1Typo: Int? /// Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). public var minWordSizefor2Typos: Int? - public var typoTolerance: TypoTolerance? + public var typoTolerance: RecommendTypoTolerance? /// Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant /// matches when searching in large sets of similar numbers. public var allowTyposOnNumericTokens: Bool? @@ -224,8 +225,8 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { /// of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding /// synonyms if your attributes have intentional unusual spellings that might look like typos. public var disableTypoToleranceOnAttributes: [String]? - public var ignorePlurals: IgnorePlurals? - public var removeStopWords: RemoveStopWords? + public var ignorePlurals: RecommendIgnorePlurals? + public var removeStopWords: RecommendRemoveStopWords? /// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For /// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep /// their diacritics. @@ -246,10 +247,10 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { public var enableRules: Bool? /// Whether to enable Personalization. public var enablePersonalization: Bool? - public var queryType: QueryType? - public var removeWordsIfNoResults: RemoveWordsIfNoResults? - public var mode: Mode? - public var semanticSearch: SemanticSearch? + public var queryType: RecommendQueryType? + public var removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? + public var mode: RecommendMode? + public var semanticSearch: RecommendSemanticSearch? /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? @@ -271,20 +272,20 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { /// product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on /// other attributes. This reduces the impact of individual attributes with a lot of content on ranking. public var disableExactOnAttributes: [String]? - public var exactOnSingleWordQuery: ExactOnSingleWordQuery? + public var exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? /// Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
///
ignorePlurals
Plurals and similar declensions added by the `ignorePlurals` setting /// are considered exact matches.
singleWordSynonym
Single-word synonyms, such as /// \"NY/NYC\" are considered exact matches.
multiWordsSynonym
Multi-word synonyms, /// such as \"NY/New York\" are considered exact matches.
. - public var alternativesAsExact: [AlternativesAsExact]? + public var alternativesAsExact: [RecommendAlternativesAsExact]? /// Advanced search syntax features you want to support.
exactPhrase
Phrases in /// quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact /// string \"iPhone case\".
excludeWords
Query words prefixed with a `-` must not /// occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". ///
This setting only has an effect if `advancedSyntax` is true. - public var advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? - public var distinct: Distinct? + public var advancedSyntaxFeatures: [RecommendAdvancedSyntaxFeatures]? + public var distinct: RecommendDistinct? /// Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted /// even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records /// matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are @@ -317,20 +318,20 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { /// matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching /// attribute is determined by the order in the `searchableAttributes` setting. public var attributeCriteriaComputedByMinProximity: Bool? - public var renderingContent: RenderingContent? + public var renderingContent: RecommendRenderingContent? /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. public var enableReRanking: Bool? - public var reRankingApplyFilter: ReRankingApplyFilter? + public var reRankingApplyFilter: RecommendReRankingApplyFilter? public init( query: String? = nil, similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: RecommendFacetFilters? = nil, + optionalFilters: RecommendOptionalFilters? = nil, + numericFilters: RecommendNumericFilters? = nil, + tagFilters: RecommendTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -340,8 +341,8 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: RecommendAroundRadius? = nil, + aroundPrecision: RecommendAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, @@ -369,27 +370,27 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { hitsPerPage: Int? = nil, minWordSizefor1Typo: Int? = nil, minWordSizefor2Typos: Int? = nil, - typoTolerance: TypoTolerance? = nil, + typoTolerance: RecommendTypoTolerance? = nil, allowTyposOnNumericTokens: Bool? = nil, disableTypoToleranceOnAttributes: [String]? = nil, - ignorePlurals: IgnorePlurals? = nil, - removeStopWords: RemoveStopWords? = nil, + ignorePlurals: RecommendIgnorePlurals? = nil, + removeStopWords: RecommendRemoveStopWords? = nil, keepDiacriticsOnCharacters: String? = nil, queryLanguages: [String]? = nil, decompoundQuery: Bool? = nil, enableRules: Bool? = nil, enablePersonalization: Bool? = nil, - queryType: QueryType? = nil, - removeWordsIfNoResults: RemoveWordsIfNoResults? = nil, - mode: Mode? = nil, - semanticSearch: SemanticSearch? = nil, + queryType: RecommendQueryType? = nil, + removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? = nil, + mode: RecommendMode? = nil, + semanticSearch: RecommendSemanticSearch? = nil, advancedSyntax: Bool? = nil, optionalWords: [String]? = nil, disableExactOnAttributes: [String]? = nil, - exactOnSingleWordQuery: ExactOnSingleWordQuery? = nil, - alternativesAsExact: [AlternativesAsExact]? = nil, - advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? = nil, - distinct: Distinct? = nil, + exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? = nil, + alternativesAsExact: [RecommendAlternativesAsExact]? = nil, + advancedSyntaxFeatures: [RecommendAdvancedSyntaxFeatures]? = nil, + distinct: RecommendDistinct? = nil, replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, @@ -397,9 +398,9 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, - renderingContent: RenderingContent? = nil, + renderingContent: RecommendRenderingContent? = nil, enableReRanking: Bool? = nil, - reRankingApplyFilter: ReRankingApplyFilter? = nil + reRankingApplyFilter: RecommendReRankingApplyFilter? = nil ) { self.query = query self.similarQuery = similarQuery diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchParamsQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSearchParamsQuery.swift similarity index 84% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchParamsQuery.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSearchParamsQuery.swift index cb5d2e5641d..d21b3bf9ba6 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchParamsQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSearchParamsQuery.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct SearchParamsQuery: Codable, JSONEncodable, Hashable { +public struct RecommendSearchParamsQuery: Codable, JSONEncodable, Hashable { /// Search query. public var query: String? diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SemanticSearch.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSemanticSearch.swift similarity index 88% rename from clients/algoliasearch-client-swift/Sources/Search/Models/SemanticSearch.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSemanticSearch.swift index a17535074be..2950e85d49b 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SemanticSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSemanticSearch.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Settings for the semantic search part of NeuralSearch. Only used when `mode` is `neuralSearch`. -public struct SemanticSearch: Codable, JSONEncodable, Hashable { +public struct RecommendSemanticSearch: Codable, JSONEncodable, Hashable { /// Indices from which to collect click and conversion events. If null, the current index and all its replicas are /// used. public var eventSources: [String]? diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSnippetResult.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSnippetResult.swift new file mode 100644 index 00000000000..a3360d18197 --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSnippetResult.swift @@ -0,0 +1,55 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +public enum RecommendSnippetResult: Codable, JSONEncodable, AbstractEncodable, Hashable { + case recommendSnippetResultOption(RecommendSnippetResultOption) + case arrayOfRecommendSnippetResultOption([RecommendSnippetResultOption]) + case dictionaryOfStringToRecommendSnippetResultOption([String: RecommendSnippetResultOption]) + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .recommendSnippetResultOption(value): + try container.encode(value) + case let .arrayOfRecommendSnippetResultOption(value): + try container.encode(value) + case let .dictionaryOfStringToRecommendSnippetResultOption(value): + try container.encode(value) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(RecommendSnippetResultOption.self) { + self = .recommendSnippetResultOption(value) + } else if let value = try? container.decode([RecommendSnippetResultOption].self) { + self = .arrayOfRecommendSnippetResultOption(value) + } else if let value = try? container.decode([String: RecommendSnippetResultOption].self) { + self = .dictionaryOfStringToRecommendSnippetResultOption(value) + } else { + throw DecodingError.typeMismatch( + Self.Type.self, + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendSnippetResult" + ) + ) + } + } + + public func GetActualInstance() -> Encodable { + switch self { + case let .recommendSnippetResultOption(value): + value as RecommendSnippetResultOption + case let .arrayOfRecommendSnippetResultOption(value): + value as [RecommendSnippetResultOption] + case let .dictionaryOfStringToRecommendSnippetResultOption(value): + value as [String: RecommendSnippetResultOption] + } + } +} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SnippetResultOption.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSnippetResultOption.swift similarity index 77% rename from clients/algoliasearch-client-swift/Sources/Search/Models/SnippetResultOption.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSnippetResultOption.swift index 86d42783787..3dcb6418109 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SnippetResultOption.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSnippetResultOption.swift @@ -1,17 +1,18 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Snippets that show the context around a matching search query. -public struct SnippetResultOption: Codable, JSONEncodable, Hashable { +public struct RecommendSnippetResultOption: Codable, JSONEncodable, Hashable { /// Highlighted attribute value, including HTML tags. public var value: String - public var matchLevel: MatchLevel + public var matchLevel: RecommendMatchLevel - public init(value: String, matchLevel: MatchLevel) { + public init(value: String, matchLevel: RecommendMatchLevel) { self.value = value self.matchLevel = matchLevel } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SortRemainingBy.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSortRemainingBy.swift similarity index 88% rename from clients/algoliasearch-client-swift/Sources/Search/Models/SortRemainingBy.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSortRemainingBy.swift index 76657f1a082..09c5f9df3f7 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SortRemainingBy.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendSortRemainingBy.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Order of facet values that aren't explicitly positioned with the `order` setting. <dl> /// <dt><code>count</code></dt> <dd> Order remaining facet values by decreasing count. The @@ -11,7 +12,7 @@ import Foundation /// <dt><code>alpha</code></dt> <dd>Sort facet values alphabetically.</dd> /// <dt><code>hidden</code></dt> <dd>Don't show facet values that aren't /// explicitly positioned.</dd> </dl>. -public enum SortRemainingBy: String, Codable, CaseIterable { +public enum RecommendSortRemainingBy: String, Codable, CaseIterable { case count case alpha case hidden diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/TagFilters.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTagFilters.swift similarity index 66% rename from clients/algoliasearch-client-swift/Sources/Search/Models/TagFilters.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTagFilters.swift index b4a02e0732b..563e971b934 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/TagFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTagFilters.swift @@ -1,24 +1,25 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filter the search by values of the special `_tags` attribute. **Prefer using the `filters` /// parameter, which supports all filter types and combinations with boolean operators.** Different from regular /// facets, `_tags` can only be used for filtering (including or excluding records). You won't get a facet /// count. The same combination and escaping rules apply as for `facetFilters`. -public enum TagFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum RecommendTagFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) - case arrayOfMixedSearchFilters([MixedSearchFilters]) + case arrayOfRecommendMixedSearchFilters([RecommendMixedSearchFilters]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .string(value): try container.encode(value) - case let .arrayOfMixedSearchFilters(value): + case let .arrayOfRecommendMixedSearchFilters(value): try container.encode(value) } } @@ -27,12 +28,15 @@ public enum TagFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { let container = try decoder.singleValueContainer() if let value = try? container.decode(String.self) { self = .string(value) - } else if let value = try? container.decode([MixedSearchFilters].self) { - self = .arrayOfMixedSearchFilters(value) + } else if let value = try? container.decode([RecommendMixedSearchFilters].self) { + self = .arrayOfRecommendMixedSearchFilters(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of TagFilters") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendTagFilters" + ) ) } } @@ -41,8 +45,8 @@ public enum TagFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { switch self { case let .string(value): value as String - case let .arrayOfMixedSearchFilters(value): - value as [MixedSearchFilters] + case let .arrayOfRecommendMixedSearchFilters(value): + value as [RecommendMixedSearchFilters] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/TaskStatus.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTaskStatus.swift similarity index 76% rename from clients/algoliasearch-client-swift/Sources/Search/Models/TaskStatus.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTaskStatus.swift index 0011cf8b587..f2874c6b5cf 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/TaskStatus.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTaskStatus.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Task status, `published` if the task is completed, `notPublished` otherwise. -public enum TaskStatus: String, Codable, CaseIterable { +public enum RecommendTaskStatus: String, Codable, CaseIterable { case published case notPublished } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/TypoTolerance.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTypoTolerance.swift similarity index 67% rename from clients/algoliasearch-client-swift/Sources/Search/Models/TypoTolerance.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTypoTolerance.swift index 12e48dc6cbf..15f61c83fbc 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/TypoTolerance.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTypoTolerance.swift @@ -1,24 +1,25 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Whether [typo /// tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/) is enabled /// and how it is applied. If typo tolerance is true, `min`, or `strict`, [word splitting and concetenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) /// is also active. -public enum TypoTolerance: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum RecommendTypoTolerance: Codable, JSONEncodable, AbstractEncodable, Hashable { case bool(Bool) - case typoToleranceEnum(TypoToleranceEnum) + case recommendTypoToleranceEnum(RecommendTypoToleranceEnum) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .bool(value): try container.encode(value) - case let .typoToleranceEnum(value): + case let .recommendTypoToleranceEnum(value): try container.encode(value) } } @@ -27,12 +28,15 @@ public enum TypoTolerance: Codable, JSONEncodable, AbstractEncodable, Hashable { let container = try decoder.singleValueContainer() if let value = try? container.decode(Bool.self) { self = .bool(value) - } else if let value = try? container.decode(TypoToleranceEnum.self) { - self = .typoToleranceEnum(value) + } else if let value = try? container.decode(RecommendTypoToleranceEnum.self) { + self = .recommendTypoToleranceEnum(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of TypoTolerance") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of RecommendTypoTolerance" + ) ) } } @@ -41,8 +45,8 @@ public enum TypoTolerance: Codable, JSONEncodable, AbstractEncodable, Hashable { switch self { case let .bool(value): value as Bool - case let .typoToleranceEnum(value): - value as TypoToleranceEnum + case let .recommendTypoToleranceEnum(value): + value as RecommendTypoToleranceEnum } } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/TypoToleranceEnum.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTypoToleranceEnum.swift similarity index 85% rename from clients/algoliasearch-client-swift/Sources/Search/Models/TypoToleranceEnum.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTypoToleranceEnum.swift index dbb88423caa..f7731ff2e76 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/TypoToleranceEnum.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendTypoToleranceEnum.swift @@ -1,15 +1,16 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// - `min`. Return matches with the lowest number of typos. For example, if you have matches without typos, /// only include those. But if there are no matches without typos (with 1 typo), include matches with 1 typo (2 /// typos). - `strict`. Return matches with the two lowest numbers of typos. With `strict`, the /// Typo ranking criterion is applied first in the `ranking` setting. -public enum TypoToleranceEnum: String, Codable, CaseIterable { +public enum RecommendTypoToleranceEnum: String, Codable, CaseIterable { case min case strict } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Value.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendValue.swift similarity index 77% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Value.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendValue.swift index 37997a3745c..e65568f70cf 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Value.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendValue.swift @@ -1,17 +1,18 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct Value: Codable, JSONEncodable, Hashable { +public struct RecommendValue: Codable, JSONEncodable, Hashable { /// Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at /// the top of the list. public var order: [String]? - public var sortRemainingBy: SortRemainingBy? + public var sortRemainingBy: RecommendSortRemainingBy? - public init(order: [String]? = nil, sortRemainingBy: SortRemainingBy? = nil) { + public init(order: [String]? = nil, sortRemainingBy: RecommendSortRemainingBy? = nil) { self.order = order self.sortRemainingBy = sortRemainingBy } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationModels.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationModels.swift index 8a508c49a62..f834c407c04 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationModels.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationModels.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Recommendation model. public enum RecommendationModels: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsHit.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsHit.swift index 9cb3f274b46..dc321f39e04 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsHit.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsHit.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum RecommendationsHit: Codable, JSONEncodable, AbstractEncodable, Hashable { case recommendHit(RecommendHit) diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsHits.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsHits.swift index 436f2f8d3c7..83af36916b2 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsHits.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsHits.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct RecommendationsHits: Codable, JSONEncodable, Hashable { public var hits: [RecommendationsHit] diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsQuery.swift index 02d2680f955..6bc1032ba5c 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct RecommendationsQuery: Codable, JSONEncodable, Hashable { static let thresholdRule = NumericRule( @@ -24,8 +25,8 @@ public struct RecommendationsQuery: Codable, JSONEncodable, Hashable { public var model: RecommendationModels /// Unique record identifier. public var objectID: String - public var queryParameters: SearchParamsObject? - public var fallbackParameters: SearchParamsObject? + public var queryParameters: RecommendSearchParamsObject? + public var fallbackParameters: RecommendSearchParamsObject? public init( indexName: String, @@ -33,8 +34,8 @@ public struct RecommendationsQuery: Codable, JSONEncodable, Hashable { maxRecommendations: Int? = nil, model: RecommendationModels, objectID: String, - queryParameters: SearchParamsObject? = nil, - fallbackParameters: SearchParamsObject? = nil + queryParameters: RecommendSearchParamsObject? = nil, + fallbackParameters: RecommendSearchParamsObject? = nil ) { self.indexName = indexName self.threshold = threshold diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsRequest.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsRequest.swift index ffa7d0a4c84..e5af41fdd6c 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsRequest.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsRequest.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum RecommendationsRequest: Codable, JSONEncodable, AbstractEncodable, Hashable { case recommendationsQuery(RecommendationsQuery) diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsResults.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsResults.swift index 5c03076e584..845dd4950eb 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsResults.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendationsResults.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct RecommendationsResults: Codable, JSONEncodable, Hashable { static let abTestVariantIDRule = NumericRule( @@ -40,7 +41,7 @@ public struct RecommendationsResults: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Distance from a central coordinate provided by `aroundLatLng`. public var automaticRadius: String? - public var exhaustive: Exhaustive? + public var exhaustive: RecommendExhaustive? /// See the `facetsCount` field of the `exhaustive` object in the response. @available(*, deprecated, message: "This property is deprecated.") public var exhaustiveFacetsCount: Bool? @@ -53,7 +54,7 @@ public struct RecommendationsResults: Codable, JSONEncodable, Hashable { /// Facet counts. public var facets: [String: [String: Int]]? /// Statistics for numerical facets. - public var facetsStats: [String: FacetsStats]? + public var facetsStats: [String: RecommendFacetsStats]? /// Number of hits per page. public var hitsPerPage: Int /// Index name used for the query. @@ -80,8 +81,8 @@ public struct RecommendationsResults: Codable, JSONEncodable, Hashable { public var processingTimingsMS: AnyCodable? /// Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set. public var queryAfterRemoval: String? - public var redirect: Redirect? - public var renderingContent: RenderingContent? + public var redirect: RecommendRedirect? + public var renderingContent: RecommendRenderingContent? /// Time the server took to process the request, in milliseconds. public var serverTimeMS: Int? /// Host name of the server that processed the request. @@ -102,12 +103,12 @@ public struct RecommendationsResults: Codable, JSONEncodable, Hashable { abTestVariantID: Int? = nil, aroundLatLng: String? = nil, automaticRadius: String? = nil, - exhaustive: Exhaustive? = nil, + exhaustive: RecommendExhaustive? = nil, exhaustiveFacetsCount: Bool? = nil, exhaustiveNbHits: Bool? = nil, exhaustiveTypo: Bool? = nil, facets: [String: [String: Int]]? = nil, - facetsStats: [String: FacetsStats]? = nil, + facetsStats: [String: RecommendFacetsStats]? = nil, hitsPerPage: Int, index: String? = nil, indexUsed: String? = nil, @@ -120,8 +121,8 @@ public struct RecommendationsResults: Codable, JSONEncodable, Hashable { processingTimeMS: Int, processingTimingsMS: AnyCodable? = nil, queryAfterRemoval: String? = nil, - redirect: Redirect? = nil, - renderingContent: RenderingContent? = nil, + redirect: RecommendRedirect? = nil, + renderingContent: RecommendRenderingContent? = nil, serverTimeMS: Int? = nil, serverUsed: String? = nil, userData: AnyCodable? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouModel.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouModel.swift index f09e0f1a231..363f872f54c 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouModel.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouModel.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Recommended for you model. public enum RecommendedForYouModel: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQuery.swift index 069f67c0a4c..e6ed29eb4cc 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct RecommendedForYouQuery: Codable, JSONEncodable, Hashable { static let thresholdRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQueryParameters.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQueryParameters.swift index f00d4e127ae..ec6e66e039f 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQueryParameters.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RecommendedForYouQueryParameters.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct RecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( @@ -84,10 +85,10 @@ public struct RecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: RecommendFacetFilters? + public var optionalFilters: RecommendOptionalFilters? + public var numericFilters: RecommendNumericFilters? + public var tagFilters: RecommendTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -114,8 +115,8 @@ public struct RecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: RecommendAroundRadius? + public var aroundPrecision: RecommendAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -213,7 +214,7 @@ public struct RecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable public var minWordSizefor1Typo: Int? /// Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). public var minWordSizefor2Typos: Int? - public var typoTolerance: TypoTolerance? + public var typoTolerance: RecommendTypoTolerance? /// Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant /// matches when searching in large sets of similar numbers. public var allowTyposOnNumericTokens: Bool? @@ -224,8 +225,8 @@ public struct RecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable /// of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding /// synonyms if your attributes have intentional unusual spellings that might look like typos. public var disableTypoToleranceOnAttributes: [String]? - public var ignorePlurals: IgnorePlurals? - public var removeStopWords: RemoveStopWords? + public var ignorePlurals: RecommendIgnorePlurals? + public var removeStopWords: RecommendRemoveStopWords? /// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For /// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep /// their diacritics. @@ -246,10 +247,10 @@ public struct RecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable public var enableRules: Bool? /// Whether to enable Personalization. public var enablePersonalization: Bool? - public var queryType: QueryType? - public var removeWordsIfNoResults: RemoveWordsIfNoResults? - public var mode: Mode? - public var semanticSearch: SemanticSearch? + public var queryType: RecommendQueryType? + public var removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? + public var mode: RecommendMode? + public var semanticSearch: RecommendSemanticSearch? /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? @@ -271,20 +272,20 @@ public struct RecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable /// product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on /// other attributes. This reduces the impact of individual attributes with a lot of content on ranking. public var disableExactOnAttributes: [String]? - public var exactOnSingleWordQuery: ExactOnSingleWordQuery? + public var exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? /// Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
///
ignorePlurals
Plurals and similar declensions added by the `ignorePlurals` setting /// are considered exact matches.
singleWordSynonym
Single-word synonyms, such as /// \"NY/NYC\" are considered exact matches.
multiWordsSynonym
Multi-word synonyms, /// such as \"NY/New York\" are considered exact matches.
. - public var alternativesAsExact: [AlternativesAsExact]? + public var alternativesAsExact: [RecommendAlternativesAsExact]? /// Advanced search syntax features you want to support.
exactPhrase
Phrases in /// quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact /// string \"iPhone case\".
excludeWords
Query words prefixed with a `-` must not /// occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". ///
This setting only has an effect if `advancedSyntax` is true. - public var advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? - public var distinct: Distinct? + public var advancedSyntaxFeatures: [RecommendAdvancedSyntaxFeatures]? + public var distinct: RecommendDistinct? /// Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted /// even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records /// matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are @@ -317,20 +318,20 @@ public struct RecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable /// matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching /// attribute is determined by the order in the `searchableAttributes` setting. public var attributeCriteriaComputedByMinProximity: Bool? - public var renderingContent: RenderingContent? + public var renderingContent: RecommendRenderingContent? /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. public var enableReRanking: Bool? - public var reRankingApplyFilter: ReRankingApplyFilter? + public var reRankingApplyFilter: RecommendReRankingApplyFilter? public init( query: String? = nil, similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: RecommendFacetFilters? = nil, + optionalFilters: RecommendOptionalFilters? = nil, + numericFilters: RecommendNumericFilters? = nil, + tagFilters: RecommendTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -340,8 +341,8 @@ public struct RecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: RecommendAroundRadius? = nil, + aroundPrecision: RecommendAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, @@ -369,27 +370,27 @@ public struct RecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable hitsPerPage: Int? = nil, minWordSizefor1Typo: Int? = nil, minWordSizefor2Typos: Int? = nil, - typoTolerance: TypoTolerance? = nil, + typoTolerance: RecommendTypoTolerance? = nil, allowTyposOnNumericTokens: Bool? = nil, disableTypoToleranceOnAttributes: [String]? = nil, - ignorePlurals: IgnorePlurals? = nil, - removeStopWords: RemoveStopWords? = nil, + ignorePlurals: RecommendIgnorePlurals? = nil, + removeStopWords: RecommendRemoveStopWords? = nil, keepDiacriticsOnCharacters: String? = nil, queryLanguages: [String]? = nil, decompoundQuery: Bool? = nil, enableRules: Bool? = nil, enablePersonalization: Bool? = nil, - queryType: QueryType? = nil, - removeWordsIfNoResults: RemoveWordsIfNoResults? = nil, - mode: Mode? = nil, - semanticSearch: SemanticSearch? = nil, + queryType: RecommendQueryType? = nil, + removeWordsIfNoResults: RecommendRemoveWordsIfNoResults? = nil, + mode: RecommendMode? = nil, + semanticSearch: RecommendSemanticSearch? = nil, advancedSyntax: Bool? = nil, optionalWords: [String]? = nil, disableExactOnAttributes: [String]? = nil, - exactOnSingleWordQuery: ExactOnSingleWordQuery? = nil, - alternativesAsExact: [AlternativesAsExact]? = nil, - advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? = nil, - distinct: Distinct? = nil, + exactOnSingleWordQuery: RecommendExactOnSingleWordQuery? = nil, + alternativesAsExact: [RecommendAlternativesAsExact]? = nil, + advancedSyntaxFeatures: [RecommendAdvancedSyntaxFeatures]? = nil, + distinct: RecommendDistinct? = nil, replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, @@ -397,9 +398,9 @@ public struct RecommendedForYouQueryParameters: Codable, JSONEncodable, Hashable maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, - renderingContent: RenderingContent? = nil, + renderingContent: RecommendRenderingContent? = nil, enableReRanking: Bool? = nil, - reRankingApplyFilter: ReRankingApplyFilter? = nil + reRankingApplyFilter: RecommendReRankingApplyFilter? = nil ) { self.query = query self.similarQuery = similarQuery diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RuleResponse.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RuleResponse.swift index 930bff99574..f21a96ef4b5 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RuleResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RuleResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Rule object. public struct RuleResponse: Codable, JSONEncodable, Hashable { @@ -12,8 +13,8 @@ public struct RuleResponse: Codable, JSONEncodable, Hashable { public var objectID: String /// [Conditions](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#conditions) required to /// activate a rule. You can use up to 25 conditions per rule. - public var conditions: [Condition]? - public var consequence: Consequence? + public var conditions: [RecommendCondition]? + public var consequence: RecommendConsequence? /// Description of the rule's purpose. This can be helpful for display in the Algolia dashboard. public var description: String? /// Indicates whether to enable the rule. If it isn't enabled, it isn't applied at query time. @@ -22,8 +23,8 @@ public struct RuleResponse: Codable, JSONEncodable, Hashable { public init( metadata: RuleResponseMetadata? = nil, objectID: String, - conditions: [Condition]? = nil, - consequence: Consequence? = nil, + conditions: [RecommendCondition]? = nil, + consequence: RecommendConsequence? = nil, description: String? = nil, enabled: Bool? = nil ) { diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RuleResponseMetadata.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RuleResponseMetadata.swift index a449446ad67..8f1c1569635 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RuleResponseMetadata.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/RuleResponseMetadata.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct RuleResponseMetadata: Codable, JSONEncodable, Hashable { /// Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchRecommendRulesParams.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchRecommendRulesParams.swift index 5d8ee83c8bd..2e85eec9358 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchRecommendRulesParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchRecommendRulesParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Recommend rules search parameters. public struct SearchRecommendRulesParams: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchRecommendRulesResponse.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchRecommendRulesResponse.swift index b62f335b18e..965340b9504 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchRecommendRulesResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/SearchRecommendRulesResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchRecommendRulesResponse: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SnippetResult.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/SnippetResult.swift deleted file mode 100644 index 76b28935304..00000000000 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SnippetResult.swift +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -public enum SnippetResult: Codable, JSONEncodable, AbstractEncodable, Hashable { - case snippetResultOption(SnippetResultOption) - case arrayOfSnippetResultOption([SnippetResultOption]) - case dictionaryOfStringToSnippetResultOption([String: SnippetResultOption]) - - public func encode(to encoder: Encoder) throws { - var container = encoder.singleValueContainer() - switch self { - case let .snippetResultOption(value): - try container.encode(value) - case let .arrayOfSnippetResultOption(value): - try container.encode(value) - case let .dictionaryOfStringToSnippetResultOption(value): - try container.encode(value) - } - } - - public init(from decoder: Decoder) throws { - let container = try decoder.singleValueContainer() - if let value = try? container.decode(SnippetResultOption.self) { - self = .snippetResultOption(value) - } else if let value = try? container.decode([SnippetResultOption].self) { - self = .arrayOfSnippetResultOption(value) - } else if let value = try? container.decode([String: SnippetResultOption].self) { - self = .dictionaryOfStringToSnippetResultOption(value) - } else { - throw DecodingError.typeMismatch( - Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of SnippetResult") - ) - } - } - - public func GetActualInstance() -> Encodable { - switch self { - case let .snippetResultOption(value): - value as SnippetResultOption - case let .arrayOfSnippetResultOption(value): - value as [SnippetResultOption] - case let .dictionaryOfStringToSnippetResultOption(value): - value as [String: SnippetResultOption] - } - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetHit.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetHit.swift index d8d2742dcf6..f3a01514087 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetHit.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetHit.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Trending facet hit. public struct TrendingFacetHit: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetsModel.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetsModel.swift index fb5ea0e511a..2301020c594 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetsModel.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetsModel.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Trending facets model. public enum TrendingFacetsModel: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetsQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetsQuery.swift index 0bca62ec85a..a3b722a6d49 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetsQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingFacetsQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TrendingFacetsQuery: Codable, JSONEncodable, Hashable { static let thresholdRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingItemsModel.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingItemsModel.swift index b24ba8a5d9e..6c269f83d98 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingItemsModel.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingItemsModel.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Trending items model. public enum TrendingItemsModel: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingItemsQuery.swift b/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingItemsQuery.swift index f6df6b78e35..5d7e73dac97 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingItemsQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/Models/TrendingItemsQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TrendingItemsQuery: Codable, JSONEncodable, Hashable { static let thresholdRule = NumericRule( @@ -26,8 +27,8 @@ public struct TrendingItemsQuery: Codable, JSONEncodable, Hashable { /// Facet value for trending models. public var facetValue: String? public var model: TrendingItemsModel? - public var queryParameters: SearchParamsObject? - public var fallbackParameters: SearchParamsObject? + public var queryParameters: RecommendSearchParamsObject? + public var fallbackParameters: RecommendSearchParamsObject? public init( indexName: String, @@ -36,8 +37,8 @@ public struct TrendingItemsQuery: Codable, JSONEncodable, Hashable { facetName: String? = nil, facetValue: String? = nil, model: TrendingItemsModel? = nil, - queryParameters: SearchParamsObject? = nil, - fallbackParameters: SearchParamsObject? = nil + queryParameters: RecommendSearchParamsObject? = nil, + fallbackParameters: RecommendSearchParamsObject? = nil ) { self.indexName = indexName self.threshold = threshold diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClient.swift b/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClient.swift index 8eccdf8d160..946ddb9e926 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClient.swift @@ -1,31 +1,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation - -typealias Client = RecommendClient +#if canImport(Core) + import Core +#endif open class RecommendClient { - private var configuration: Configuration + private var configuration: RecommendClientConfiguration private var transporter: Transporter var appID: String { self.configuration.appID } - public init(configuration: Configuration, transporter: Transporter) { + public init(configuration: RecommendClientConfiguration, transporter: Transporter) { self.configuration = configuration self.transporter = transporter } - public convenience init(configuration: Configuration) { + public convenience init(configuration: RecommendClientConfiguration) { self.init(configuration: configuration, transporter: Transporter(configuration: configuration)) } public convenience init(appID: String, apiKey: String) throws { - try self.init(configuration: Configuration(appID: appID, apiKey: apiKey)) + try self.init(configuration: RecommendClientConfiguration(appID: appID, apiKey: apiKey)) } /// - parameter path: (path) Path of the endpoint, anything after \"/1\" must be specified. @@ -76,7 +75,7 @@ open class RecommendClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -138,7 +137,7 @@ open class RecommendClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -206,7 +205,7 @@ open class RecommendClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -274,7 +273,7 @@ open class RecommendClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -292,15 +291,15 @@ open class RecommendClient { /// - parameter model: (path) [Recommend /// models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models). /// - parameter objectID: (path) Unique record identifier. - /// - returns: DeletedAtResponse + /// - returns: RecommendDeletedAtResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func deleteRecommendRule( indexName: String, model: RecommendModels, objectID: String, requestOptions: RequestOptions? = nil - ) async throws -> DeletedAtResponse { - let response: Response = try await deleteRecommendRuleWithHTTPInfo( + ) async throws -> RecommendDeletedAtResponse { + let response: Response = try await deleteRecommendRuleWithHTTPInfo( indexName: indexName, model: model, objectID: objectID, @@ -324,14 +323,14 @@ open class RecommendClient { // models](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models). // // - parameter objectID: (path) Unique record identifier. - // - returns: RequestBuilder + // - returns: RequestBuilder open func deleteRecommendRuleWithHTTPInfo( indexName: String, model: RecommendModels, objectID: String, requestOptions userRequestOptions: RequestOptions? = nil - ) async throws -> Response { + ) async throws -> Response { guard !indexName.isEmpty else { throw AlgoliaError.invalidArgument("indexName", "deleteRecommendRule") } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Configuration.swift b/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClientConfiguration.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Recommend/Configuration.swift rename to clients/algoliasearch-client-swift/Sources/Recommend/RecommendClientConfiguration.swift index 7a8f94a9ffc..5d6b6944d02 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Configuration.swift +++ b/clients/algoliasearch-client-swift/Sources/Recommend/RecommendClientConfiguration.swift @@ -1,13 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -typealias RecommendClientConfiguration = Configuration - -public struct Configuration: Core.Configuration, Credentials { +public struct RecommendClientConfiguration: BaseConfiguration, Credentials { public let appID: String public let apiKey: String public var writeTimeout: TimeInterval diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Acl.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/Acl.swift index 579c11ec279..7f4c5476b59 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Acl.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/Acl.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Access control list permissions. public enum Acl: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Action.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/Action.swift index 7c6deacbb8f..af446656b3c 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Action.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/Action.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Type of indexing operation. public enum Action: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/AddApiKeyResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/AddApiKeyResponse.swift index d7e10b02365..8d9c40649a3 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/AddApiKeyResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/AddApiKeyResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct AddApiKeyResponse: Codable, JSONEncodable, Hashable { /// API key. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ApiKey.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/ApiKey.swift index c8484dfde6d..ef5d05f269f 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ApiKey.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/ApiKey.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// API key object. public struct ApiKey: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ApiKeyOperation.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/ApiKeyOperation.swift index 3a6c40d248f..895eee3f74b 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ApiKeyOperation.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/ApiKeyOperation.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum ApiKeyOperation: String, Codable, CaseIterable { case add diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/AssignUserIdParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/AssignUserIdParams.swift index d69c157f24c..17dfaed5f45 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/AssignUserIdParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/AssignUserIdParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Assign userID parameters. public struct AssignUserIdParams: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/AttributeToUpdate.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/AttributeToUpdate.swift index fe3c1ea7ce5..25d80b1b30d 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/AttributeToUpdate.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/AttributeToUpdate.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum AttributeToUpdate: Codable, JSONEncodable, AbstractEncodable, Hashable { case builtInOperation(BuiltInOperation) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BaseGetApiKeyResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BaseGetApiKeyResponse.swift index f40cc01ae3a..062e5f61331 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BaseGetApiKeyResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BaseGetApiKeyResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BaseGetApiKeyResponse: Codable, JSONEncodable, Hashable { /// API key. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BaseIndexSettings.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BaseIndexSettings.swift index 456f0bcd1ff..931ec0db771 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BaseIndexSettings.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BaseIndexSettings.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BaseIndexSettings: Codable, JSONEncodable, Hashable { static let paginationLimitedToRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchAssignUserIdsParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchAssignUserIdsParams.swift index ceeff275fb9..aac7198ba57 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchAssignUserIdsParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchAssignUserIdsParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Assign userID parameters. public struct BatchAssignUserIdsParams: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchDictionaryEntriesParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchDictionaryEntriesParams.swift index e273b5f1007..25bcf513f47 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchDictionaryEntriesParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchDictionaryEntriesParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Request body for updating dictionary entries. public struct BatchDictionaryEntriesParams: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchDictionaryEntriesRequest.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchDictionaryEntriesRequest.swift index ebbc6750384..25748ba0bda 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchDictionaryEntriesRequest.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchDictionaryEntriesRequest.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BatchDictionaryEntriesRequest: Codable, JSONEncodable, Hashable { public var action: DictionaryAction diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchParams.swift index c6ebc7ed8a3..248a2b64b2f 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Batch parameters. public struct BatchParams: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchRequest.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchRequest.swift index b8595a754a4..7396fe03320 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchRequest.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchRequest.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BatchRequest: Codable, JSONEncodable, Hashable { public var action: Action diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchResponse.swift index 2ae4d73ea4e..7fc9b1a2539 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BatchResponse: Codable, JSONEncodable, Hashable { /// Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchWriteParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchWriteParams.swift index 10ac8263142..e7ee5d7d841 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BatchWriteParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BatchWriteParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Batch parameters. public struct BatchWriteParams: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParams.swift index 1afb7017f47..4609323965d 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum BrowseParams: Codable, JSONEncodable, AbstractEncodable, Hashable { case browseParamsObject(BrowseParamsObject) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParamsObject.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParamsObject.swift index 2fec6ad47ee..1ef70421e4d 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParamsObject.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseParamsObject.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( @@ -84,10 +85,10 @@ public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: SearchFacetFilters? + public var optionalFilters: SearchOptionalFilters? + public var numericFilters: SearchNumericFilters? + public var tagFilters: SearchTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -114,8 +115,8 @@ public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: SearchAroundRadius? + public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -213,7 +214,7 @@ public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { public var minWordSizefor1Typo: Int? /// Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). public var minWordSizefor2Typos: Int? - public var typoTolerance: TypoTolerance? + public var typoTolerance: SearchTypoTolerance? /// Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant /// matches when searching in large sets of similar numbers. public var allowTyposOnNumericTokens: Bool? @@ -224,8 +225,8 @@ public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { /// of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding /// synonyms if your attributes have intentional unusual spellings that might look like typos. public var disableTypoToleranceOnAttributes: [String]? - public var ignorePlurals: IgnorePlurals? - public var removeStopWords: RemoveStopWords? + public var ignorePlurals: SearchIgnorePlurals? + public var removeStopWords: SearchRemoveStopWords? /// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For /// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep /// their diacritics. @@ -246,10 +247,10 @@ public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { public var enableRules: Bool? /// Whether to enable Personalization. public var enablePersonalization: Bool? - public var queryType: QueryType? - public var removeWordsIfNoResults: RemoveWordsIfNoResults? - public var mode: Mode? - public var semanticSearch: SemanticSearch? + public var queryType: SearchQueryType? + public var removeWordsIfNoResults: SearchRemoveWordsIfNoResults? + public var mode: SearchMode? + public var semanticSearch: SearchSemanticSearch? /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? @@ -271,20 +272,20 @@ public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { /// product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on /// other attributes. This reduces the impact of individual attributes with a lot of content on ranking. public var disableExactOnAttributes: [String]? - public var exactOnSingleWordQuery: ExactOnSingleWordQuery? + public var exactOnSingleWordQuery: SearchExactOnSingleWordQuery? /// Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
///
ignorePlurals
Plurals and similar declensions added by the `ignorePlurals` setting /// are considered exact matches.
singleWordSynonym
Single-word synonyms, such as /// \"NY/NYC\" are considered exact matches.
multiWordsSynonym
Multi-word synonyms, /// such as \"NY/New York\" are considered exact matches.
. - public var alternativesAsExact: [AlternativesAsExact]? + public var alternativesAsExact: [SearchAlternativesAsExact]? /// Advanced search syntax features you want to support.
exactPhrase
Phrases in /// quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact /// string \"iPhone case\".
excludeWords
Query words prefixed with a `-` must not /// occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". ///
This setting only has an effect if `advancedSyntax` is true. - public var advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? - public var distinct: Distinct? + public var advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? + public var distinct: SearchDistinct? /// Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted /// even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records /// matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are @@ -317,11 +318,11 @@ public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { /// matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching /// attribute is determined by the order in the `searchableAttributes` setting. public var attributeCriteriaComputedByMinProximity: Bool? - public var renderingContent: RenderingContent? + public var renderingContent: SearchRenderingContent? /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. public var enableReRanking: Bool? - public var reRankingApplyFilter: ReRankingApplyFilter? + public var reRankingApplyFilter: SearchReRankingApplyFilter? /// Cursor to get the next page of the response. The parameter must match the value returned in the response of a /// previous request. The last page of the response does not return a `cursor` attribute. public var cursor: String? @@ -330,10 +331,10 @@ public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { query: String? = nil, similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: SearchFacetFilters? = nil, + optionalFilters: SearchOptionalFilters? = nil, + numericFilters: SearchNumericFilters? = nil, + tagFilters: SearchTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -343,8 +344,8 @@ public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: SearchAroundRadius? = nil, + aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, @@ -372,27 +373,27 @@ public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { hitsPerPage: Int? = nil, minWordSizefor1Typo: Int? = nil, minWordSizefor2Typos: Int? = nil, - typoTolerance: TypoTolerance? = nil, + typoTolerance: SearchTypoTolerance? = nil, allowTyposOnNumericTokens: Bool? = nil, disableTypoToleranceOnAttributes: [String]? = nil, - ignorePlurals: IgnorePlurals? = nil, - removeStopWords: RemoveStopWords? = nil, + ignorePlurals: SearchIgnorePlurals? = nil, + removeStopWords: SearchRemoveStopWords? = nil, keepDiacriticsOnCharacters: String? = nil, queryLanguages: [String]? = nil, decompoundQuery: Bool? = nil, enableRules: Bool? = nil, enablePersonalization: Bool? = nil, - queryType: QueryType? = nil, - removeWordsIfNoResults: RemoveWordsIfNoResults? = nil, - mode: Mode? = nil, - semanticSearch: SemanticSearch? = nil, + queryType: SearchQueryType? = nil, + removeWordsIfNoResults: SearchRemoveWordsIfNoResults? = nil, + mode: SearchMode? = nil, + semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, optionalWords: [String]? = nil, disableExactOnAttributes: [String]? = nil, - exactOnSingleWordQuery: ExactOnSingleWordQuery? = nil, - alternativesAsExact: [AlternativesAsExact]? = nil, - advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? = nil, - distinct: Distinct? = nil, + exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, + alternativesAsExact: [SearchAlternativesAsExact]? = nil, + advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? = nil, + distinct: SearchDistinct? = nil, replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, @@ -400,9 +401,9 @@ public struct BrowseParamsObject: Codable, JSONEncodable, Hashable { maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, - renderingContent: RenderingContent? = nil, + renderingContent: SearchRenderingContent? = nil, enableReRanking: Bool? = nil, - reRankingApplyFilter: ReRankingApplyFilter? = nil, + reRankingApplyFilter: SearchReRankingApplyFilter? = nil, cursor: String? = nil ) { self.query = query diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseResponse.swift index 36bd8bd975a..71b16330621 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BrowseResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct BrowseResponse: Codable, JSONEncodable, Hashable { static let abTestVariantIDRule = NumericRule( @@ -40,7 +41,7 @@ public struct BrowseResponse: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Distance from a central coordinate provided by `aroundLatLng`. public var automaticRadius: String? - public var exhaustive: Exhaustive? + public var exhaustive: SearchExhaustive? /// See the `facetsCount` field of the `exhaustive` object in the response. @available(*, deprecated, message: "This property is deprecated.") public var exhaustiveFacetsCount: Bool? @@ -53,7 +54,7 @@ public struct BrowseResponse: Codable, JSONEncodable, Hashable { /// Facet counts. public var facets: [String: [String: Int]]? /// Statistics for numerical facets. - public var facetsStats: [String: FacetsStats]? + public var facetsStats: [String: SearchFacetsStats]? /// Number of hits per page. public var hitsPerPage: Int /// Index name used for the query. @@ -80,8 +81,8 @@ public struct BrowseResponse: Codable, JSONEncodable, Hashable { public var processingTimingsMS: AnyCodable? /// Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set. public var queryAfterRemoval: String? - public var redirect: Redirect? - public var renderingContent: RenderingContent? + public var redirect: SearchRedirect? + public var renderingContent: SearchRenderingContent? /// Time the server took to process the request, in milliseconds. public var serverTimeMS: Int? /// Host name of the server that processed the request. @@ -107,12 +108,12 @@ public struct BrowseResponse: Codable, JSONEncodable, Hashable { abTestVariantID: Int? = nil, aroundLatLng: String? = nil, automaticRadius: String? = nil, - exhaustive: Exhaustive? = nil, + exhaustive: SearchExhaustive? = nil, exhaustiveFacetsCount: Bool? = nil, exhaustiveNbHits: Bool? = nil, exhaustiveTypo: Bool? = nil, facets: [String: [String: Int]]? = nil, - facetsStats: [String: FacetsStats]? = nil, + facetsStats: [String: SearchFacetsStats]? = nil, hitsPerPage: Int, index: String? = nil, indexUsed: String? = nil, @@ -125,8 +126,8 @@ public struct BrowseResponse: Codable, JSONEncodable, Hashable { processingTimeMS: Int, processingTimingsMS: AnyCodable? = nil, queryAfterRemoval: String? = nil, - redirect: Redirect? = nil, - renderingContent: RenderingContent? = nil, + redirect: SearchRedirect? = nil, + renderingContent: SearchRenderingContent? = nil, serverTimeMS: Int? = nil, serverUsed: String? = nil, userData: AnyCodable? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BuiltInOperation.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BuiltInOperation.swift index 3e47349d0f1..bfa57e24b37 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BuiltInOperation.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BuiltInOperation.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Update to perform on the attribute. public struct BuiltInOperation: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/BuiltInOperationType.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/BuiltInOperationType.swift index 0a4d9fa0e19..518f1b0e850 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/BuiltInOperationType.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/BuiltInOperationType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// How to change the attribute. public enum BuiltInOperationType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/CreatedAtResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/CreatedAtResponse.swift index 706dad7b7b1..91deb60532b 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/CreatedAtResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/CreatedAtResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Response and creation timestamp. public struct CreatedAtResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Cursor.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/Cursor.swift index 590358b76d2..76aceaabdea 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Cursor.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/Cursor.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct Cursor: Codable, JSONEncodable, Hashable { /// Cursor to get the next page of the response. The parameter must match the value returned in the response of a diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteApiKeyResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteApiKeyResponse.swift index ca28262d5d6..27b0df97001 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteApiKeyResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteApiKeyResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct DeleteApiKeyResponse: Codable, JSONEncodable, Hashable { /// Timestamp of deletion in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteByParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteByParams.swift index b04aedd0dd1..80030fc20e6 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteByParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteByParams.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct DeleteByParams: Codable, JSONEncodable, Hashable { - public var facetFilters: FacetFilters? + public var facetFilters: SearchFacetFilters? /// Filter the search so that only records with matching values are included in the results. These filters are /// supported: - **Numeric filters.** ` `, where `` is one of `<`, `<=`, `=`, `!=`, `>`, /// `>=`. - **Ranges.** `: TO ` where `` and `` are the lower and upper limits of @@ -21,14 +22,14 @@ public struct DeleteByParams: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var numericFilters: SearchNumericFilters? + public var tagFilters: SearchTagFilters? /// Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only /// records included within circle around this central location are included in the results. The radius of the /// circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you /// also specify `insidePolygon` or `insideBoundingBox`. public var aroundLatLng: String? - public var aroundRadius: AroundRadius? + public var aroundRadius: SearchAroundRadius? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points /// of its diagonal, and expressed as latitude and longitude pair: `[p1 lat, p1 long, p2 lat, p2 long]`. Provide /// multiple bounding boxes as nested arrays. For more information, see [rectangular area](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). @@ -40,12 +41,12 @@ public struct DeleteByParams: Codable, JSONEncodable, Hashable { public var insidePolygon: [[Double]]? public init( - facetFilters: FacetFilters? = nil, + facetFilters: SearchFacetFilters? = nil, filters: String? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + numericFilters: SearchNumericFilters? = nil, + tagFilters: SearchTagFilters? = nil, aroundLatLng: String? = nil, - aroundRadius: AroundRadius? = nil, + aroundRadius: SearchAroundRadius? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil ) { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteSourceResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteSourceResponse.swift index 24a33b399f8..8a26664fa95 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteSourceResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/DeleteSourceResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct DeleteSourceResponse: Codable, JSONEncodable, Hashable { /// Timestamp of deletion in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryAction.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryAction.swift index 6cd2097a919..41a68ccdebd 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryAction.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryAction.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Actions to perform. public enum DictionaryAction: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryEntry.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryEntry.swift index 3c708fa0e43..22e40a8f910 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryEntry.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryEntry.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Dictionary entry. public struct DictionaryEntry: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryEntryState.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryEntryState.swift index 795ddb2a629..db189028ed2 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryEntryState.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryEntryState.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Whether a dictionary entry is active. public enum DictionaryEntryState: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryLanguage.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryLanguage.swift index 1ca2e61498e..55bb580c472 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryLanguage.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryLanguage.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Dictionary type. If `null`, this dictionary type isn't supported for the language. public struct DictionaryLanguage: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionarySettingsParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionarySettingsParams.swift index be0b141bd14..210bd986f0a 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionarySettingsParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionarySettingsParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Turn on or off the built-in Algolia stop words for a specific language. public struct DictionarySettingsParams: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryType.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryType.swift index a7c728d2c99..eaa01e53681 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryType.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/DictionaryType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum DictionaryType: String, Codable, CaseIterable { case plurals diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/ErrorBase.swift deleted file mode 100644 index 29817fdeb5c..00000000000 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ErrorBase.swift +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -/// Error. -public struct ErrorBase: Codable, JSONEncodable, Hashable { - public var message: String? - - public init(message: String? = nil) { - self.message = message - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case message - } - - public var additionalProperties: [String: AnyCodable] = [:] - - public subscript(key: String) -> AnyCodable? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - self.additionalProperties[key] = newValue - } - } - - public init(from dictionary: [String: AnyCodable]) throws { - self.message = dictionary["message"]?.value as? String - - for (key, value) in dictionary { - switch key { - case "message": - continue - default: - self.additionalProperties[key] = value - } - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(self.message, forKey: .message) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(self.additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - - self.message = try container.decodeIfPresent(String.self, forKey: .message) - var nonAdditionalPropertyKeys = Set() - nonAdditionalPropertyKeys.insert("message") - let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) - self.additionalProperties = try additionalPropertiesContainer.decodeMap( - AnyCodable.self, - excludedKeys: nonAdditionalPropertyKeys - ) - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/FacetHits.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/FacetHits.swift index 2b9b51e47cd..2441937fcdd 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/FacetHits.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/FacetHits.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct FacetHits: Codable, JSONEncodable, Hashable { /// Facet value. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/FetchedIndex.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/FetchedIndex.swift index 0f9a3821e69..8e4be646dd7 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/FetchedIndex.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/FetchedIndex.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct FetchedIndex: Codable, JSONEncodable, Hashable { /// Index name. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/GetApiKeyResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/GetApiKeyResponse.swift index 92c76d49ec5..cb7c7430682 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/GetApiKeyResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/GetApiKeyResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetApiKeyResponse: Codable, JSONEncodable, Hashable { /// API key. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/GetDictionarySettingsResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/GetDictionarySettingsResponse.swift index 7202a288951..ecc5422d886 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/GetDictionarySettingsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/GetDictionarySettingsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetDictionarySettingsResponse: Codable, JSONEncodable, Hashable { public var disableStandardEntries: StandardEntries diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/GetLogsResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/GetLogsResponse.swift index dec72f5015e..e904c63fef3 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/GetLogsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/GetLogsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetLogsResponse: Codable, JSONEncodable, Hashable { public var logs: [Log] diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsParams.swift index 8cf57f5c8ea..d5f99ace2a2 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Request parameters. public struct GetObjectsParams: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsRequest.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsRequest.swift index b5a31fb74c5..88936740aaf 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsRequest.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsRequest.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Request body for retrieving records. public struct GetObjectsRequest: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsResponse.swift index 3c11cddc865..99f25d3ea93 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/GetObjectsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetObjectsResponse: Codable, JSONEncodable, Hashable { /// Retrieved records. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/GetTaskResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/GetTaskResponse.swift index c6cf434b2e2..b3afd1db22c 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/GetTaskResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/GetTaskResponse.swift @@ -1,14 +1,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct GetTaskResponse: Codable, JSONEncodable, Hashable { - public var status: TaskStatus + public var status: SearchTaskStatus - public init(status: TaskStatus) { + public init(status: SearchTaskStatus) { self.status = status } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/GetTopUserIdsResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/GetTopUserIdsResponse.swift index 849396843d2..b089ceb7492 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/GetTopUserIdsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/GetTopUserIdsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// User IDs and clusters. public struct GetTopUserIdsResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/HasPendingMappingsResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/HasPendingMappingsResponse.swift index fe4ae180361..4b28b421fc2 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/HasPendingMappingsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/HasPendingMappingsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct HasPendingMappingsResponse: Codable, JSONEncodable, Hashable { /// Whether there are clusters undergoing migration, creation, or deletion. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/HighlightResult.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/HighlightResult.swift deleted file mode 100644 index 9be15ebe4eb..00000000000 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/HighlightResult.swift +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -public enum HighlightResult: Codable, JSONEncodable, AbstractEncodable, Hashable { - case highlightResultOption(HighlightResultOption) - case arrayOfHighlightResultOption([HighlightResultOption]) - case dictionaryOfStringToHighlightResultOption([String: HighlightResultOption]) - - public func encode(to encoder: Encoder) throws { - var container = encoder.singleValueContainer() - switch self { - case let .highlightResultOption(value): - try container.encode(value) - case let .arrayOfHighlightResultOption(value): - try container.encode(value) - case let .dictionaryOfStringToHighlightResultOption(value): - try container.encode(value) - } - } - - public init(from decoder: Decoder) throws { - let container = try decoder.singleValueContainer() - if let value = try? container.decode(HighlightResultOption.self) { - self = .highlightResultOption(value) - } else if let value = try? container.decode([HighlightResultOption].self) { - self = .arrayOfHighlightResultOption(value) - } else if let value = try? container.decode([String: HighlightResultOption].self) { - self = .dictionaryOfStringToHighlightResultOption(value) - } else { - throw DecodingError.typeMismatch( - Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of HighlightResult") - ) - } - } - - public func GetActualInstance() -> Encodable { - switch self { - case let .highlightResultOption(value): - value as HighlightResultOption - case let .arrayOfHighlightResultOption(value): - value as [HighlightResultOption] - case let .dictionaryOfStringToHighlightResultOption(value): - value as [String: HighlightResultOption] - } - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Hit.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/Hit.swift index 75e8a92ea05..3607d9fb6cc 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Hit.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/Hit.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Search result. A hit is a record from your index, augmented with special attributes for highlighting, snippeting, /// and ranking. @@ -11,17 +12,17 @@ public struct Hit: Codable, JSONEncodable, Hashable { /// Unique record identifier. public var objectID: String /// Surround words that match the query with HTML tags for highlighting. - public var highlightResult: [String: HighlightResult]? + public var highlightResult: [String: SearchHighlightResult]? /// Snippets that show the context around a matching search query. - public var snippetResult: [String: SnippetResult]? - public var rankingInfo: RankingInfo? + public var snippetResult: [String: SearchSnippetResult]? + public var rankingInfo: SearchRankingInfo? public var distinctSeqID: Int? public init( objectID: String, - highlightResult: [String: HighlightResult]? = nil, - snippetResult: [String: SnippetResult]? = nil, - rankingInfo: RankingInfo? = nil, + highlightResult: [String: SearchHighlightResult]? = nil, + snippetResult: [String: SearchSnippetResult]? = nil, + rankingInfo: SearchRankingInfo? = nil, distinctSeqID: Int? = nil ) { self.objectID = objectID @@ -59,11 +60,11 @@ public struct Hit: Codable, JSONEncodable, Hashable { throw GenericError(description: "Failed to cast") } self.objectID = objectID - self.highlightResult = dictionary["highlightResult"]?.value as? [String: HighlightResult] + self.highlightResult = dictionary["highlightResult"]?.value as? [String: SearchHighlightResult] - self.snippetResult = dictionary["snippetResult"]?.value as? [String: SnippetResult] + self.snippetResult = dictionary["snippetResult"]?.value as? [String: SearchSnippetResult] - self.rankingInfo = dictionary["rankingInfo"]?.value as? RankingInfo + self.rankingInfo = dictionary["rankingInfo"]?.value as? SearchRankingInfo self.distinctSeqID = dictionary["distinctSeqID"]?.value as? Int @@ -96,9 +97,12 @@ public struct Hit: Codable, JSONEncodable, Hashable { let container = try decoder.container(keyedBy: CodingKeys.self) self.objectID = try container.decode(String.self, forKey: .objectID) - self.highlightResult = try container.decodeIfPresent([String: HighlightResult].self, forKey: .highlightResult) - self.snippetResult = try container.decodeIfPresent([String: SnippetResult].self, forKey: .snippetResult) - self.rankingInfo = try container.decodeIfPresent(RankingInfo.self, forKey: .rankingInfo) + self.highlightResult = try container.decodeIfPresent( + [String: SearchHighlightResult].self, + forKey: .highlightResult + ) + self.snippetResult = try container.decodeIfPresent([String: SearchSnippetResult].self, forKey: .snippetResult) + self.rankingInfo = try container.decodeIfPresent(SearchRankingInfo.self, forKey: .rankingInfo) self.distinctSeqID = try container.decodeIfPresent(Int.self, forKey: .distinctSeqID) var nonAdditionalPropertyKeys = Set() nonAdditionalPropertyKeys.insert("objectID") diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/IndexSettings.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/IndexSettings.swift index 7273faca991..9881e742aec 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/IndexSettings.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/IndexSettings.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Index settings. public struct IndexSettings: Codable, JSONEncodable, Hashable { @@ -190,7 +191,7 @@ public struct IndexSettings: Codable, JSONEncodable, Hashable { public var minWordSizefor1Typo: Int? /// Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). public var minWordSizefor2Typos: Int? - public var typoTolerance: TypoTolerance? + public var typoTolerance: SearchTypoTolerance? /// Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant /// matches when searching in large sets of similar numbers. public var allowTyposOnNumericTokens: Bool? @@ -201,8 +202,8 @@ public struct IndexSettings: Codable, JSONEncodable, Hashable { /// of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding /// synonyms if your attributes have intentional unusual spellings that might look like typos. public var disableTypoToleranceOnAttributes: [String]? - public var ignorePlurals: IgnorePlurals? - public var removeStopWords: RemoveStopWords? + public var ignorePlurals: SearchIgnorePlurals? + public var removeStopWords: SearchRemoveStopWords? /// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For /// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep /// their diacritics. @@ -223,10 +224,10 @@ public struct IndexSettings: Codable, JSONEncodable, Hashable { public var enableRules: Bool? /// Whether to enable Personalization. public var enablePersonalization: Bool? - public var queryType: QueryType? - public var removeWordsIfNoResults: RemoveWordsIfNoResults? - public var mode: Mode? - public var semanticSearch: SemanticSearch? + public var queryType: SearchQueryType? + public var removeWordsIfNoResults: SearchRemoveWordsIfNoResults? + public var mode: SearchMode? + public var semanticSearch: SearchSemanticSearch? /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? @@ -248,20 +249,20 @@ public struct IndexSettings: Codable, JSONEncodable, Hashable { /// product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on /// other attributes. This reduces the impact of individual attributes with a lot of content on ranking. public var disableExactOnAttributes: [String]? - public var exactOnSingleWordQuery: ExactOnSingleWordQuery? + public var exactOnSingleWordQuery: SearchExactOnSingleWordQuery? /// Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
///
ignorePlurals
Plurals and similar declensions added by the `ignorePlurals` setting /// are considered exact matches.
singleWordSynonym
Single-word synonyms, such as /// \"NY/NYC\" are considered exact matches.
multiWordsSynonym
Multi-word synonyms, /// such as \"NY/New York\" are considered exact matches.
. - public var alternativesAsExact: [AlternativesAsExact]? + public var alternativesAsExact: [SearchAlternativesAsExact]? /// Advanced search syntax features you want to support.
exactPhrase
Phrases in /// quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact /// string \"iPhone case\".
excludeWords
Query words prefixed with a `-` must not /// occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". ///
This setting only has an effect if `advancedSyntax` is true. - public var advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? - public var distinct: Distinct? + public var advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? + public var distinct: SearchDistinct? /// Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted /// even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records /// matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are @@ -294,11 +295,11 @@ public struct IndexSettings: Codable, JSONEncodable, Hashable { /// matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching /// attribute is determined by the order in the `searchableAttributes` setting. public var attributeCriteriaComputedByMinProximity: Bool? - public var renderingContent: RenderingContent? + public var renderingContent: SearchRenderingContent? /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. public var enableReRanking: Bool? - public var reRankingApplyFilter: ReRankingApplyFilter? + public var reRankingApplyFilter: SearchReRankingApplyFilter? public init( attributesForFaceting: [String]? = nil, @@ -331,27 +332,27 @@ public struct IndexSettings: Codable, JSONEncodable, Hashable { hitsPerPage: Int? = nil, minWordSizefor1Typo: Int? = nil, minWordSizefor2Typos: Int? = nil, - typoTolerance: TypoTolerance? = nil, + typoTolerance: SearchTypoTolerance? = nil, allowTyposOnNumericTokens: Bool? = nil, disableTypoToleranceOnAttributes: [String]? = nil, - ignorePlurals: IgnorePlurals? = nil, - removeStopWords: RemoveStopWords? = nil, + ignorePlurals: SearchIgnorePlurals? = nil, + removeStopWords: SearchRemoveStopWords? = nil, keepDiacriticsOnCharacters: String? = nil, queryLanguages: [String]? = nil, decompoundQuery: Bool? = nil, enableRules: Bool? = nil, enablePersonalization: Bool? = nil, - queryType: QueryType? = nil, - removeWordsIfNoResults: RemoveWordsIfNoResults? = nil, - mode: Mode? = nil, - semanticSearch: SemanticSearch? = nil, + queryType: SearchQueryType? = nil, + removeWordsIfNoResults: SearchRemoveWordsIfNoResults? = nil, + mode: SearchMode? = nil, + semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, optionalWords: [String]? = nil, disableExactOnAttributes: [String]? = nil, - exactOnSingleWordQuery: ExactOnSingleWordQuery? = nil, - alternativesAsExact: [AlternativesAsExact]? = nil, - advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? = nil, - distinct: Distinct? = nil, + exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, + alternativesAsExact: [SearchAlternativesAsExact]? = nil, + advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? = nil, + distinct: SearchDistinct? = nil, replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, @@ -359,9 +360,9 @@ public struct IndexSettings: Codable, JSONEncodable, Hashable { maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, - renderingContent: RenderingContent? = nil, + renderingContent: SearchRenderingContent? = nil, enableReRanking: Bool? = nil, - reRankingApplyFilter: ReRankingApplyFilter? = nil + reRankingApplyFilter: SearchReRankingApplyFilter? = nil ) { self.attributesForFaceting = attributesForFaceting self.replicas = replicas diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ListApiKeysResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/ListApiKeysResponse.swift index c3f3f64c9a0..96e386d89c9 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ListApiKeysResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/ListApiKeysResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ListApiKeysResponse: Codable, JSONEncodable, Hashable { /// API keys. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ListClustersResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/ListClustersResponse.swift index d6bde07c97d..18961a3b1f2 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ListClustersResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/ListClustersResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Clusters. public struct ListClustersResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ListIndicesResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/ListIndicesResponse.swift index 139c3d63498..46e51592302 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ListIndicesResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/ListIndicesResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ListIndicesResponse: Codable, JSONEncodable, Hashable { /// All indices in your Algolia application. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ListUserIdsResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/ListUserIdsResponse.swift index f4242ceb5da..822cc8252f0 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ListUserIdsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/ListUserIdsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// User ID data. public struct ListUserIdsResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Log.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/Log.swift index a0a4a077aad..2dfe4e4d290 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Log.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/Log.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct Log: Codable, JSONEncodable, Hashable { static let queryBodyRule = StringRule(minLength: nil, maxLength: 1000, pattern: nil) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/LogQuery.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/LogQuery.swift index 80f434a400a..6eb6c672b54 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/LogQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/LogQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct LogQuery: Codable, JSONEncodable, Hashable { /// Index targeted by the query. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/LogType.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/LogType.swift index 6d972a3f5c2..680011ea5df 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/LogType.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/LogType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum LogType: String, Codable, CaseIterable { case all diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/MultipleBatchRequest.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/MultipleBatchRequest.swift index 69d9384e7de..0717c5ddf29 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/MultipleBatchRequest.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/MultipleBatchRequest.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct MultipleBatchRequest: Codable, JSONEncodable, Hashable { public var action: Action diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/MultipleBatchResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/MultipleBatchResponse.swift index d039fd1cd75..842032b50d3 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/MultipleBatchResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/MultipleBatchResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct MultipleBatchResponse: Codable, JSONEncodable, Hashable { /// Task IDs. One for each index. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/OperationIndexParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/OperationIndexParams.swift index 52225e7bbb8..e0c55191eee 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/OperationIndexParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/OperationIndexParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct OperationIndexParams: Codable, JSONEncodable, Hashable { public var operation: OperationType diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/OperationType.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/OperationType.swift index 500f546d0f4..314dbdd706c 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/OperationType.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/OperationType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Operation to perform on the index. public enum OperationType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Params.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/Params.swift deleted file mode 100644 index 6d25007bfa4..00000000000 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Params.swift +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -/// Parameters to apply to this search. You can use all search parameters, plus special -/// `automaticFacetFilters`, `automaticOptionalFacetFilters`, and `query`. -public struct Params: Codable, JSONEncodable, Hashable { - public var query: ConsequenceQuery? - public var automaticFacetFilters: AutomaticFacetFilters? - public var automaticOptionalFacetFilters: AutomaticFacetFilters? - public var renderingContent: RenderingContent? - - public init( - query: ConsequenceQuery? = nil, - automaticFacetFilters: AutomaticFacetFilters? = nil, - automaticOptionalFacetFilters: AutomaticFacetFilters? = nil, - renderingContent: RenderingContent? = nil - ) { - self.query = query - self.automaticFacetFilters = automaticFacetFilters - self.automaticOptionalFacetFilters = automaticOptionalFacetFilters - self.renderingContent = renderingContent - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case query - case automaticFacetFilters - case automaticOptionalFacetFilters - case renderingContent - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(self.query, forKey: .query) - try container.encodeIfPresent(self.automaticFacetFilters, forKey: .automaticFacetFilters) - try container.encodeIfPresent(self.automaticOptionalFacetFilters, forKey: .automaticOptionalFacetFilters) - try container.encodeIfPresent(self.renderingContent, forKey: .renderingContent) - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Promote.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/Promote.swift deleted file mode 100644 index 96e66ed1fe8..00000000000 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Promote.swift +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -public enum Promote: Codable, JSONEncodable, AbstractEncodable, Hashable { - case promoteObjectID(PromoteObjectID) - case promoteObjectIDs(PromoteObjectIDs) - - public func encode(to encoder: Encoder) throws { - var container = encoder.singleValueContainer() - switch self { - case let .promoteObjectID(value): - try container.encode(value) - case let .promoteObjectIDs(value): - try container.encode(value) - } - } - - public init(from decoder: Decoder) throws { - let container = try decoder.singleValueContainer() - if let value = try? container.decode(PromoteObjectID.self) { - self = .promoteObjectID(value) - } else if let value = try? container.decode(PromoteObjectIDs.self) { - self = .promoteObjectIDs(value) - } else { - throw DecodingError.typeMismatch( - Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of Promote") - ) - } - } - - public func GetActualInstance() -> Encodable { - switch self { - case let .promoteObjectID(value): - value as PromoteObjectID - case let .promoteObjectIDs(value): - value as PromoteObjectIDs - } - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/RemoveUserIdResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/RemoveUserIdResponse.swift index 697b917d05c..2d69bd38bd3 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/RemoveUserIdResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/RemoveUserIdResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct RemoveUserIdResponse: Codable, JSONEncodable, Hashable { /// Timestamp of deletion in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ReplaceSourceResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/ReplaceSourceResponse.swift index a3f2167b426..9ee008be332 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ReplaceSourceResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/ReplaceSourceResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct ReplaceSourceResponse: Codable, JSONEncodable, Hashable { /// Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Rule.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/Rule.swift index e3c97e10d25..7ed1c7f17d7 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Rule.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/Rule.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Rule object. public struct Rule: Codable, JSONEncodable, Hashable { @@ -12,8 +13,8 @@ public struct Rule: Codable, JSONEncodable, Hashable { /// Conditions that trigger a rule. Some consequences require specific conditions or don't require any condition. /// For more information, see /// [Conditions](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#conditions). - public var conditions: [Condition]? - public var consequence: Consequence? + public var conditions: [SearchCondition]? + public var consequence: SearchConsequence? /// Description of the rule's purpose to help you distinguish between different rules. public var description: String? /// Whether the rule is active. @@ -23,8 +24,8 @@ public struct Rule: Codable, JSONEncodable, Hashable { public init( objectID: String, - conditions: [Condition]? = nil, - consequence: Consequence? = nil, + conditions: [SearchCondition]? = nil, + consequence: SearchConsequence? = nil, description: String? = nil, enabled: Bool? = nil, validity: [TimeRange]? = nil diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SaveObjectResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SaveObjectResponse.swift index 8e082ce9696..02573b5885f 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SaveObjectResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SaveObjectResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SaveObjectResponse: Codable, JSONEncodable, Hashable { /// Timestamp when the record was added, in ISO 8601 format. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SaveSynonymResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SaveSynonymResponse.swift index 22ef234ca50..e3b7d9a4f35 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SaveSynonymResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SaveSynonymResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SaveSynonymResponse: Codable, JSONEncodable, Hashable { /// Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ScopeType.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/ScopeType.swift index 3b7fc900163..004de1a86df 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ScopeType.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/ScopeType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum ScopeType: String, Codable, CaseIterable { case settings diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AdvancedSyntaxFeatures.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAdvancedSyntaxFeatures.swift similarity index 67% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/AdvancedSyntaxFeatures.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchAdvancedSyntaxFeatures.swift index bfb6d79bf57..6b2ebd5d22b 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AdvancedSyntaxFeatures.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAdvancedSyntaxFeatures.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public enum AdvancedSyntaxFeatures: String, Codable, CaseIterable { +public enum SearchAdvancedSyntaxFeatures: String, Codable, CaseIterable { case exactPhrase case excludeWords } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/AlternativesAsExact.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAlternativesAsExact.swift similarity index 71% rename from clients/algoliasearch-client-swift/Sources/Search/Models/AlternativesAsExact.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchAlternativesAsExact.swift index 6d69bf7efe7..4d3bd3c6e4c 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/AlternativesAsExact.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAlternativesAsExact.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public enum AlternativesAsExact: String, Codable, CaseIterable { +public enum SearchAlternativesAsExact: String, Codable, CaseIterable { case ignorePlurals case singleWordSynonym case multiWordsSynonym diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Anchoring.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAnchoring.swift similarity index 87% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Anchoring.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchAnchoring.swift index d46f768e403..676083da640 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Anchoring.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAnchoring.swift @@ -1,15 +1,16 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Which part of the search query the pattern should match: - `startsWith`. The pattern must match the /// begginning of the query. - `endsWith`. The pattern must match the end of the query. - `is`. The /// pattern must match the query exactly. - `contains`. The pattern must match anywhere in the query. Empty /// queries are only allowed as pattern with `anchoring: is`. -public enum Anchoring: String, Codable, CaseIterable { +public enum SearchAnchoring: String, Codable, CaseIterable { case `is` case startsWith case endsWith diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/AroundPrecision.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundPrecision.swift similarity index 59% rename from clients/algoliasearch-client-swift/Sources/Search/Models/AroundPrecision.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundPrecision.swift index 9c258f57f9e..ed0e7ecf247 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/AroundPrecision.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundPrecision.swift @@ -1,22 +1,23 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Precision of a coordinate-based search in meters to group results with similar distances. The Geo ranking criterion /// considers all matches within the same range of distances to be equal. -public enum AroundPrecision: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum SearchAroundPrecision: Codable, JSONEncodable, AbstractEncodable, Hashable { case int(Int) - case arrayOfAroundPrecisionFromValueInner([AroundPrecisionFromValueInner]) + case arrayOfSearchAroundPrecisionFromValueInner([SearchAroundPrecisionFromValueInner]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .int(value): try container.encode(value) - case let .arrayOfAroundPrecisionFromValueInner(value): + case let .arrayOfSearchAroundPrecisionFromValueInner(value): try container.encode(value) } } @@ -25,12 +26,15 @@ public enum AroundPrecision: Codable, JSONEncodable, AbstractEncodable, Hashable let container = try decoder.singleValueContainer() if let value = try? container.decode(Int.self) { self = .int(value) - } else if let value = try? container.decode([AroundPrecisionFromValueInner].self) { - self = .arrayOfAroundPrecisionFromValueInner(value) + } else if let value = try? container.decode([SearchAroundPrecisionFromValueInner].self) { + self = .arrayOfSearchAroundPrecisionFromValueInner(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of AroundPrecision") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchAroundPrecision" + ) ) } } @@ -39,8 +43,8 @@ public enum AroundPrecision: Codable, JSONEncodable, AbstractEncodable, Hashable switch self { case let .int(value): value as Int - case let .arrayOfAroundPrecisionFromValueInner(value): - value as [AroundPrecisionFromValueInner] + case let .arrayOfSearchAroundPrecisionFromValueInner(value): + value as [SearchAroundPrecisionFromValueInner] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundPrecisionFromValueInner.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundPrecisionFromValueInner.swift similarity index 89% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundPrecisionFromValueInner.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundPrecisionFromValueInner.swift index 88f915729af..1c74c3e3a39 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AroundPrecisionFromValueInner.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundPrecisionFromValueInner.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Range object with lower and upper values in meters to define custom ranges. -public struct AroundPrecisionFromValueInner: Codable, JSONEncodable, Hashable { +public struct SearchAroundPrecisionFromValueInner: Codable, JSONEncodable, Hashable { /// Lower boundary of a range in meters. The Geo ranking criterion considers all records within the range to be /// equal. public var from: Int? diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/AroundRadius.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundRadius.swift similarity index 64% rename from clients/algoliasearch-client-swift/Sources/Search/Models/AroundRadius.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundRadius.swift index 0b309b75ba3..a7077b946dc 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/AroundRadius.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundRadius.swift @@ -1,48 +1,52 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Maximum radius for a search around a central location. This parameter works in combination with the /// `aroundLatLng` and `aroundLatLngViaIP` parameters. By default, the search radius is determined /// automatically from the density of hits around the central location. The search radius is small if there are many /// hits close to the central coordinates. -public enum AroundRadius: Codable, JSONEncodable, AbstractEncodable, Hashable { - case aroundRadiusAll(AroundRadiusAll) +public enum SearchAroundRadius: Codable, JSONEncodable, AbstractEncodable, Hashable { case int(Int) + case searchAroundRadiusAll(SearchAroundRadiusAll) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { - case let .aroundRadiusAll(value): - try container.encode(value) case let .int(value): try container.encode(value) + case let .searchAroundRadiusAll(value): + try container.encode(value) } } public init(from decoder: Decoder) throws { let container = try decoder.singleValueContainer() - if let value = try? container.decode(AroundRadiusAll.self) { - self = .aroundRadiusAll(value) - } else if let value = try? container.decode(Int.self) { + if let value = try? container.decode(Int.self) { self = .int(value) + } else if let value = try? container.decode(SearchAroundRadiusAll.self) { + self = .searchAroundRadiusAll(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of AroundRadius") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchAroundRadius" + ) ) } } public func GetActualInstance() -> Encodable { switch self { - case let .aroundRadiusAll(value): - value as AroundRadiusAll case let .int(value): value as Int + case let .searchAroundRadiusAll(value): + value as SearchAroundRadiusAll } } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/AroundRadiusAll.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundRadiusAll.swift similarity index 74% rename from clients/algoliasearch-client-swift/Sources/Search/Models/AroundRadiusAll.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundRadiusAll.swift index 7d6260ed8af..e75bc109766 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/AroundRadiusAll.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAroundRadiusAll.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Return all records with a valid `_geoloc` attribute. Don't filter by distance. -public enum AroundRadiusAll: String, Codable, CaseIterable { +public enum SearchAroundRadiusAll: String, Codable, CaseIterable { case all } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/AutomaticFacetFilter.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAutomaticFacetFilter.swift similarity index 92% rename from clients/algoliasearch-client-swift/Sources/Search/Models/AutomaticFacetFilter.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchAutomaticFacetFilter.swift index c21f67fe709..57581ccf7bf 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/AutomaticFacetFilter.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAutomaticFacetFilter.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filter or optional filter to be applied to the search. -public struct AutomaticFacetFilter: Codable, JSONEncodable, Hashable { +public struct SearchAutomaticFacetFilter: Codable, JSONEncodable, Hashable { /// Facet name to be applied as filter. The name must match placeholders in the `pattern` parameter. For example, /// with `pattern: {facet:genre}`, `automaticFacetFilters` must be `genre`. public var facet: String diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AutomaticFacetFilters.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAutomaticFacetFilters.swift similarity index 72% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/AutomaticFacetFilters.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchAutomaticFacetFilters.swift index 5f8f70dca59..d773559d746 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/AutomaticFacetFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchAutomaticFacetFilters.swift @@ -1,21 +1,22 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filter to be applied to the search. You can use this to respond to search queries that match a facet value. For /// example, if users search for \"comedy\", which matches a facet value of the \"genre\" facet, you /// can filter the results to show the top-ranked comedy movies. -public enum AutomaticFacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { - case arrayOfAutomaticFacetFilter([AutomaticFacetFilter]) +public enum SearchAutomaticFacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { + case arrayOfSearchAutomaticFacetFilter([SearchAutomaticFacetFilter]) case arrayOfString([String]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { - case let .arrayOfAutomaticFacetFilter(value): + case let .arrayOfSearchAutomaticFacetFilter(value): try container.encode(value) case let .arrayOfString(value): try container.encode(value) @@ -24,8 +25,8 @@ public enum AutomaticFacetFilters: Codable, JSONEncodable, AbstractEncodable, Ha public init(from decoder: Decoder) throws { let container = try decoder.singleValueContainer() - if let value = try? container.decode([AutomaticFacetFilter].self) { - self = .arrayOfAutomaticFacetFilter(value) + if let value = try? container.decode([SearchAutomaticFacetFilter].self) { + self = .arrayOfSearchAutomaticFacetFilter(value) } else if let value = try? container.decode([String].self) { self = .arrayOfString(value) } else { @@ -33,7 +34,7 @@ public enum AutomaticFacetFilters: Codable, JSONEncodable, AbstractEncodable, Ha Self.Type.self, .init( codingPath: decoder.codingPath, - debugDescription: "Unable to decode instance of AutomaticFacetFilters" + debugDescription: "Unable to decode instance of SearchAutomaticFacetFilters" ) ) } @@ -41,8 +42,8 @@ public enum AutomaticFacetFilters: Codable, JSONEncodable, AbstractEncodable, Ha public func GetActualInstance() -> Encodable { switch self { - case let .arrayOfAutomaticFacetFilter(value): - value as [AutomaticFacetFilter] + case let .arrayOfSearchAutomaticFacetFilter(value): + value as [SearchAutomaticFacetFilter] case let .arrayOfString(value): value as [String] } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseSearchParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParams.swift similarity index 95% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseSearchParams.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParams.swift index a89c4f703ae..3992c4df081 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseSearchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParams.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct BaseSearchParams: Codable, JSONEncodable, Hashable { +public struct SearchBaseSearchParams: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( minimum: 0, exclusiveMinimum: false, @@ -56,10 +57,10 @@ public struct BaseSearchParams: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: SearchFacetFilters? + public var optionalFilters: SearchOptionalFilters? + public var numericFilters: SearchNumericFilters? + public var tagFilters: SearchTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -86,8 +87,8 @@ public struct BaseSearchParams: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: SearchAroundRadius? + public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -135,10 +136,10 @@ public struct BaseSearchParams: Codable, JSONEncodable, Hashable { query: String? = nil, similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: SearchFacetFilters? = nil, + optionalFilters: SearchOptionalFilters? = nil, + numericFilters: SearchNumericFilters? = nil, + tagFilters: SearchTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -148,8 +149,8 @@ public struct BaseSearchParams: Codable, JSONEncodable, Hashable { length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: SearchAroundRadius? = nil, + aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseSearchParamsWithoutQuery.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParamsWithoutQuery.swift similarity index 95% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseSearchParamsWithoutQuery.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParamsWithoutQuery.swift index 8df877066c6..556fcee93f8 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseSearchParamsWithoutQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchParamsWithoutQuery.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct BaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { +public struct SearchBaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( minimum: 0, exclusiveMinimum: false, @@ -54,10 +55,10 @@ public struct BaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: SearchFacetFilters? + public var optionalFilters: SearchOptionalFilters? + public var numericFilters: SearchNumericFilters? + public var tagFilters: SearchTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -84,8 +85,8 @@ public struct BaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: SearchAroundRadius? + public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -132,10 +133,10 @@ public struct BaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { public init( similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: SearchFacetFilters? = nil, + optionalFilters: SearchOptionalFilters? = nil, + numericFilters: SearchNumericFilters? = nil, + tagFilters: SearchTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -145,8 +146,8 @@ public struct BaseSearchParamsWithoutQuery: Codable, JSONEncodable, Hashable { length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: SearchAroundRadius? = nil, + aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseSearchResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchResponse.swift similarity index 93% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseSearchResponse.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchResponse.swift index 5013027ec0b..07d2320affd 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/BaseSearchResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchBaseSearchResponse.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { +public struct SearchBaseSearchResponse: Codable, JSONEncodable, Hashable { static let abTestVariantIDRule = NumericRule( minimum: 1, exclusiveMinimum: false, @@ -40,7 +41,7 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Distance from a central coordinate provided by `aroundLatLng`. public var automaticRadius: String? - public var exhaustive: Exhaustive? + public var exhaustive: SearchExhaustive? /// See the `facetsCount` field of the `exhaustive` object in the response. @available(*, deprecated, message: "This property is deprecated.") public var exhaustiveFacetsCount: Bool? @@ -53,7 +54,7 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { /// Facet counts. public var facets: [String: [String: Int]]? /// Statistics for numerical facets. - public var facetsStats: [String: FacetsStats]? + public var facetsStats: [String: SearchFacetsStats]? /// Number of hits per page. public var hitsPerPage: Int /// Index name used for the query. @@ -80,8 +81,8 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { public var processingTimingsMS: AnyCodable? /// Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set. public var queryAfterRemoval: String? - public var redirect: Redirect? - public var renderingContent: RenderingContent? + public var redirect: SearchRedirect? + public var renderingContent: SearchRenderingContent? /// Time the server took to process the request, in milliseconds. public var serverTimeMS: Int? /// Host name of the server that processed the request. @@ -97,12 +98,12 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { abTestVariantID: Int? = nil, aroundLatLng: String? = nil, automaticRadius: String? = nil, - exhaustive: Exhaustive? = nil, + exhaustive: SearchExhaustive? = nil, exhaustiveFacetsCount: Bool? = nil, exhaustiveNbHits: Bool? = nil, exhaustiveTypo: Bool? = nil, facets: [String: [String: Int]]? = nil, - facetsStats: [String: FacetsStats]? = nil, + facetsStats: [String: SearchFacetsStats]? = nil, hitsPerPage: Int, index: String? = nil, indexUsed: String? = nil, @@ -115,8 +116,8 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { processingTimeMS: Int, processingTimingsMS: AnyCodable? = nil, queryAfterRemoval: String? = nil, - redirect: Redirect? = nil, - renderingContent: RenderingContent? = nil, + redirect: SearchRedirect? = nil, + renderingContent: SearchRenderingContent? = nil, serverTimeMS: Int? = nil, serverUsed: String? = nil, userData: AnyCodable? = nil, @@ -207,7 +208,7 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { self.automaticRadius = dictionary["automaticRadius"]?.value as? String - self.exhaustive = dictionary["exhaustive"]?.value as? Exhaustive + self.exhaustive = dictionary["exhaustive"]?.value as? SearchExhaustive self.exhaustiveFacetsCount = dictionary["exhaustiveFacetsCount"]?.value as? Bool @@ -217,7 +218,7 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { self.facets = dictionary["facets"]?.value as? [String: [String: Int]] - self.facetsStats = dictionary["facetsStats"]?.value as? [String: FacetsStats] + self.facetsStats = dictionary["facetsStats"]?.value as? [String: SearchFacetsStats] guard let hitsPerPage = dictionary["hitsPerPage"]?.value as? Int else { throw GenericError(description: "Failed to cast") @@ -253,9 +254,9 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { self.queryAfterRemoval = dictionary["queryAfterRemoval"]?.value as? String - self.redirect = dictionary["redirect"]?.value as? Redirect + self.redirect = dictionary["redirect"]?.value as? SearchRedirect - self.renderingContent = dictionary["renderingContent"]?.value as? RenderingContent + self.renderingContent = dictionary["renderingContent"]?.value as? SearchRenderingContent self.serverTimeMS = dictionary["serverTimeMS"]?.value as? Int @@ -324,12 +325,12 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { self.abTestVariantID = try container.decodeIfPresent(Int.self, forKey: .abTestVariantID) self.aroundLatLng = try container.decodeIfPresent(String.self, forKey: .aroundLatLng) self.automaticRadius = try container.decodeIfPresent(String.self, forKey: .automaticRadius) - self.exhaustive = try container.decodeIfPresent(Exhaustive.self, forKey: .exhaustive) + self.exhaustive = try container.decodeIfPresent(SearchExhaustive.self, forKey: .exhaustive) self.exhaustiveFacetsCount = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveFacetsCount) self.exhaustiveNbHits = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveNbHits) self.exhaustiveTypo = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveTypo) self.facets = try container.decodeIfPresent([String: [String: Int]].self, forKey: .facets) - self.facetsStats = try container.decodeIfPresent([String: FacetsStats].self, forKey: .facetsStats) + self.facetsStats = try container.decodeIfPresent([String: SearchFacetsStats].self, forKey: .facetsStats) self.hitsPerPage = try container.decode(Int.self, forKey: .hitsPerPage) self.index = try container.decodeIfPresent(String.self, forKey: .index) self.indexUsed = try container.decodeIfPresent(String.self, forKey: .indexUsed) @@ -342,8 +343,8 @@ public struct BaseSearchResponse: Codable, JSONEncodable, Hashable { self.processingTimeMS = try container.decode(Int.self, forKey: .processingTimeMS) self.processingTimingsMS = try container.decodeIfPresent(AnyCodable.self, forKey: .processingTimingsMS) self.queryAfterRemoval = try container.decodeIfPresent(String.self, forKey: .queryAfterRemoval) - self.redirect = try container.decodeIfPresent(Redirect.self, forKey: .redirect) - self.renderingContent = try container.decodeIfPresent(RenderingContent.self, forKey: .renderingContent) + self.redirect = try container.decodeIfPresent(SearchRedirect.self, forKey: .redirect) + self.renderingContent = try container.decodeIfPresent(SearchRenderingContent.self, forKey: .renderingContent) self.serverTimeMS = try container.decodeIfPresent(Int.self, forKey: .serverTimeMS) self.serverUsed = try container.decodeIfPresent(String.self, forKey: .serverUsed) self.userData = try container.decodeIfPresent(AnyCodable.self, forKey: .userData) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Condition.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchCondition.swift similarity index 92% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Condition.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchCondition.swift index d0a88e38381..b9b69b4caef 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Condition.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchCondition.swift @@ -1,18 +1,19 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct Condition: Codable, JSONEncodable, Hashable { +public struct SearchCondition: Codable, JSONEncodable, Hashable { static let contextRule = StringRule(minLength: nil, maxLength: nil, pattern: "[A-Za-z0-9_-]+") /// Query pattern that triggers the rule. You can use either a literal string, or a special pattern /// `{facet:ATTRIBUTE}`, where `ATTRIBUTE` is a facet name. The rule is triggered if the query matches the literal /// string or a value of the specified facet. For example, with `pattern: {facet:genre}`, the rule is triggered when /// users search for a genre, such as \"comedy\". public var pattern: String? - public var anchoring: Anchoring? + public var anchoring: SearchAnchoring? /// Whether the pattern should match plurals, synonyms, and typos. public var alternatives: Bool? /// An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` @@ -26,7 +27,7 @@ public struct Condition: Codable, JSONEncodable, Hashable { public init( pattern: String? = nil, - anchoring: Anchoring? = nil, + anchoring: SearchAnchoring? = nil, alternatives: Bool? = nil, context: String? = nil, filters: String? = nil diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Consequence.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequence.swift similarity index 85% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Consequence.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequence.swift index 999c94ed4be..91cc9c1fc99 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Consequence.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequence.swift @@ -1,32 +1,33 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Effect of the rule. For more information, see /// [Consequences](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/#consequences). -public struct Consequence: Codable, JSONEncodable, Hashable { - public var params: ConsequenceParams? +public struct SearchConsequence: Codable, JSONEncodable, Hashable { + public var params: SearchConsequenceParams? /// Records you want to pin to a specific position in the search results. You can promote up to 300 records, either /// individually, or as groups of up to 100 records each. - public var promote: [Promote]? + public var promote: [SearchPromote]? /// Whether promoted records must match an active filter for the consequence to be applied. This ensures that user /// actions (filtering the search) are given a higher precendence. For example, if you promote a record with the /// `color: red` attribute, and the user filters the search for `color: blue`, the \"red\" record won't be shown. public var filterPromotes: Bool? /// Records you want to hide from the search results. - public var hide: [ConsequenceHide]? + public var hide: [SearchConsequenceHide]? /// A JSON object with custom data that will be appended to the `userData` array in the response. This object isn't /// interpreted by the API and is limited to 1 kB of minified JSON. public var userData: AnyCodable? public init( - params: ConsequenceParams? = nil, - promote: [Promote]? = nil, + params: SearchConsequenceParams? = nil, + promote: [SearchPromote]? = nil, filterPromotes: Bool? = nil, - hide: [ConsequenceHide]? = nil, + hide: [SearchConsequenceHide]? = nil, userData: AnyCodable? = nil ) { self.params = params diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceHide.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceHide.swift similarity index 85% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceHide.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceHide.swift index 96f9cec0eff..539aeb9f06b 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceHide.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceHide.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Object ID of the record to hide. -public struct ConsequenceHide: Codable, JSONEncodable, Hashable { +public struct SearchConsequenceHide: Codable, JSONEncodable, Hashable { /// Unique record identifier. public var objectID: String diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceParams.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceParams.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceParams.swift index e030b0b76bc..234daac1daa 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceParams.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct ConsequenceParams: Codable, JSONEncodable, Hashable { +public struct SearchConsequenceParams: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( minimum: 0, exclusiveMinimum: false, @@ -82,10 +83,10 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: SearchFacetFilters? + public var optionalFilters: SearchOptionalFilters? + public var numericFilters: SearchNumericFilters? + public var tagFilters: SearchTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -112,8 +113,8 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: SearchAroundRadius? + public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -211,7 +212,7 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { public var minWordSizefor1Typo: Int? /// Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). public var minWordSizefor2Typos: Int? - public var typoTolerance: TypoTolerance? + public var typoTolerance: SearchTypoTolerance? /// Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant /// matches when searching in large sets of similar numbers. public var allowTyposOnNumericTokens: Bool? @@ -222,8 +223,8 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { /// of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding /// synonyms if your attributes have intentional unusual spellings that might look like typos. public var disableTypoToleranceOnAttributes: [String]? - public var ignorePlurals: IgnorePlurals? - public var removeStopWords: RemoveStopWords? + public var ignorePlurals: SearchIgnorePlurals? + public var removeStopWords: SearchRemoveStopWords? /// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For /// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep /// their diacritics. @@ -244,10 +245,10 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { public var enableRules: Bool? /// Whether to enable Personalization. public var enablePersonalization: Bool? - public var queryType: QueryType? - public var removeWordsIfNoResults: RemoveWordsIfNoResults? - public var mode: Mode? - public var semanticSearch: SemanticSearch? + public var queryType: SearchQueryType? + public var removeWordsIfNoResults: SearchRemoveWordsIfNoResults? + public var mode: SearchMode? + public var semanticSearch: SearchSemanticSearch? /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? @@ -269,20 +270,20 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { /// product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on /// other attributes. This reduces the impact of individual attributes with a lot of content on ranking. public var disableExactOnAttributes: [String]? - public var exactOnSingleWordQuery: ExactOnSingleWordQuery? + public var exactOnSingleWordQuery: SearchExactOnSingleWordQuery? /// Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
///
ignorePlurals
Plurals and similar declensions added by the `ignorePlurals` setting /// are considered exact matches.
singleWordSynonym
Single-word synonyms, such as /// \"NY/NYC\" are considered exact matches.
multiWordsSynonym
Multi-word synonyms, /// such as \"NY/New York\" are considered exact matches.
. - public var alternativesAsExact: [AlternativesAsExact]? + public var alternativesAsExact: [SearchAlternativesAsExact]? /// Advanced search syntax features you want to support.
exactPhrase
Phrases in /// quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact /// string \"iPhone case\".
excludeWords
Query words prefixed with a `-` must not /// occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". ///
This setting only has an effect if `advancedSyntax` is true. - public var advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? - public var distinct: Distinct? + public var advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? + public var distinct: SearchDistinct? /// Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted /// even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records /// matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are @@ -315,22 +316,22 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { /// matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching /// attribute is determined by the order in the `searchableAttributes` setting. public var attributeCriteriaComputedByMinProximity: Bool? - public var renderingContent: RenderingContent? + public var renderingContent: SearchRenderingContent? /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. public var enableReRanking: Bool? - public var reRankingApplyFilter: ReRankingApplyFilter? - public var query: ConsequenceQuery? - public var automaticFacetFilters: AutomaticFacetFilters? - public var automaticOptionalFacetFilters: AutomaticFacetFilters? + public var reRankingApplyFilter: SearchReRankingApplyFilter? + public var query: SearchConsequenceQuery? + public var automaticFacetFilters: SearchAutomaticFacetFilters? + public var automaticOptionalFacetFilters: SearchAutomaticFacetFilters? public init( similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: SearchFacetFilters? = nil, + optionalFilters: SearchOptionalFilters? = nil, + numericFilters: SearchNumericFilters? = nil, + tagFilters: SearchTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -340,8 +341,8 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: SearchAroundRadius? = nil, + aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, @@ -369,27 +370,27 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { hitsPerPage: Int? = nil, minWordSizefor1Typo: Int? = nil, minWordSizefor2Typos: Int? = nil, - typoTolerance: TypoTolerance? = nil, + typoTolerance: SearchTypoTolerance? = nil, allowTyposOnNumericTokens: Bool? = nil, disableTypoToleranceOnAttributes: [String]? = nil, - ignorePlurals: IgnorePlurals? = nil, - removeStopWords: RemoveStopWords? = nil, + ignorePlurals: SearchIgnorePlurals? = nil, + removeStopWords: SearchRemoveStopWords? = nil, keepDiacriticsOnCharacters: String? = nil, queryLanguages: [String]? = nil, decompoundQuery: Bool? = nil, enableRules: Bool? = nil, enablePersonalization: Bool? = nil, - queryType: QueryType? = nil, - removeWordsIfNoResults: RemoveWordsIfNoResults? = nil, - mode: Mode? = nil, - semanticSearch: SemanticSearch? = nil, + queryType: SearchQueryType? = nil, + removeWordsIfNoResults: SearchRemoveWordsIfNoResults? = nil, + mode: SearchMode? = nil, + semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, optionalWords: [String]? = nil, disableExactOnAttributes: [String]? = nil, - exactOnSingleWordQuery: ExactOnSingleWordQuery? = nil, - alternativesAsExact: [AlternativesAsExact]? = nil, - advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? = nil, - distinct: Distinct? = nil, + exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, + alternativesAsExact: [SearchAlternativesAsExact]? = nil, + advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? = nil, + distinct: SearchDistinct? = nil, replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, @@ -397,12 +398,12 @@ public struct ConsequenceParams: Codable, JSONEncodable, Hashable { maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, - renderingContent: RenderingContent? = nil, + renderingContent: SearchRenderingContent? = nil, enableReRanking: Bool? = nil, - reRankingApplyFilter: ReRankingApplyFilter? = nil, - query: ConsequenceQuery? = nil, - automaticFacetFilters: AutomaticFacetFilters? = nil, - automaticOptionalFacetFilters: AutomaticFacetFilters? = nil + reRankingApplyFilter: SearchReRankingApplyFilter? = nil, + query: SearchConsequenceQuery? = nil, + automaticFacetFilters: SearchAutomaticFacetFilters? = nil, + automaticOptionalFacetFilters: SearchAutomaticFacetFilters? = nil ) { self.similarQuery = similarQuery self.filters = filters diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceQuery.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceQuery.swift similarity index 63% rename from clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceQuery.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceQuery.swift index 58b7b20d534..1a98bc41a81 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ConsequenceQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceQuery.swift @@ -1,20 +1,21 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Replace or edit the search query. If `consequenceQuery` is a string, the entire search query is replaced /// with that string. If `consequenceQuery` is an object, it describes incremental edits made to the query. -public enum ConsequenceQuery: Codable, JSONEncodable, AbstractEncodable, Hashable { - case consequenceQueryObject(ConsequenceQueryObject) +public enum SearchConsequenceQuery: Codable, JSONEncodable, AbstractEncodable, Hashable { + case searchConsequenceQueryObject(SearchConsequenceQueryObject) case string(String) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { - case let .consequenceQueryObject(value): + case let .searchConsequenceQueryObject(value): try container.encode(value) case let .string(value): try container.encode(value) @@ -23,22 +24,25 @@ public enum ConsequenceQuery: Codable, JSONEncodable, AbstractEncodable, Hashabl public init(from decoder: Decoder) throws { let container = try decoder.singleValueContainer() - if let value = try? container.decode(ConsequenceQueryObject.self) { - self = .consequenceQueryObject(value) + if let value = try? container.decode(SearchConsequenceQueryObject.self) { + self = .searchConsequenceQueryObject(value) } else if let value = try? container.decode(String.self) { self = .string(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of ConsequenceQuery") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchConsequenceQuery" + ) ) } } public func GetActualInstance() -> Encodable { switch self { - case let .consequenceQueryObject(value): - value as ConsequenceQueryObject + case let .searchConsequenceQueryObject(value): + value as SearchConsequenceQueryObject case let .string(value): value as String } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceQueryObject.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceQueryObject.swift similarity index 77% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceQueryObject.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceQueryObject.swift index 38045d10b3a..1248ab55511 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ConsequenceQueryObject.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchConsequenceQueryObject.swift @@ -1,17 +1,18 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct ConsequenceQueryObject: Codable, JSONEncodable, Hashable { +public struct SearchConsequenceQueryObject: Codable, JSONEncodable, Hashable { /// Words to remove from the search query. public var remove: [String]? /// Changes to make to the search query. - public var edits: [Edit]? + public var edits: [SearchEdit]? - public init(remove: [String]? = nil, edits: [Edit]? = nil) { + public init(remove: [String]? = nil, edits: [SearchEdit]? = nil) { self.remove = remove self.edits = edits } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/DeletedAtResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDeletedAtResponse.swift similarity index 91% rename from clients/algoliasearch-client-swift/Sources/Search/Models/DeletedAtResponse.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchDeletedAtResponse.swift index 5d711f2a815..9392d27139f 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/DeletedAtResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDeletedAtResponse.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Response, taskID, and deletion timestamp. -public struct DeletedAtResponse: Codable, JSONEncodable, Hashable { +public struct SearchDeletedAtResponse: Codable, JSONEncodable, Hashable { /// Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run /// immediately. You can check the task's progress with the [`task` operation](#tag/Indices/operation/getTask) and /// this `taskID`. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDictionaryEntriesParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDictionaryEntriesParams.swift index c1274982050..43b5018f4a8 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDictionaryEntriesParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDictionaryEntriesParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Search parameter. public struct SearchDictionaryEntriesParams: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDictionaryEntriesResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDictionaryEntriesResponse.swift index de577f8551a..2b6d8eeee45 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDictionaryEntriesResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDictionaryEntriesResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchDictionaryEntriesResponse: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Distinct.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDistinct.swift similarity index 90% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Distinct.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchDistinct.swift index cbf0434d55a..de0bdf77d26 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Distinct.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchDistinct.swift @@ -1,15 +1,16 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Determines how many records of a group are included in the search results. Records with the same value for the /// `attributeForDistinct` attribute are considered a group. The `distinct` setting controls how /// many members of the group are returned. This is useful for [deduplication and grouping](https://www.algolia.com/doc/guides/managing-results/refine-results/grouping/#introducing-algolias-distinct-feature). /// The `distinct` setting is ignored if `attributeForDistinct` is not set. -public enum Distinct: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum SearchDistinct: Codable, JSONEncodable, AbstractEncodable, Hashable { case bool(Bool) case int(Int) @@ -32,7 +33,7 @@ public enum Distinct: Codable, JSONEncodable, AbstractEncodable, Hashable { } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of Distinct") + .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of SearchDistinct") ) } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Edit.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchEdit.swift similarity index 80% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Edit.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchEdit.swift index 397052f070e..144b2ccbff9 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Edit.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchEdit.swift @@ -1,18 +1,19 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct Edit: Codable, JSONEncodable, Hashable { - public var type: EditType? +public struct SearchEdit: Codable, JSONEncodable, Hashable { + public var type: SearchEditType? /// Text or patterns to remove from the query string. public var delete: String? /// Text to be added in place of the deleted text inside the query string. public var insert: String? - public init(type: EditType? = nil, delete: String? = nil, insert: String? = nil) { + public init(type: SearchEditType? = nil, delete: String? = nil, insert: String? = nil) { self.type = type self.delete = delete self.insert = insert diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/EditType.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchEditType.swift similarity index 71% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/EditType.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchEditType.swift index 28ec94f9412..a0c8284c102 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/EditType.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchEditType.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Type of edit. -public enum EditType: String, Codable, CaseIterable { +public enum SearchEditType: String, Codable, CaseIterable { case remove case replace } diff --git a/clients/algoliasearch-client-swift/Sources/Insights/Models/ErrorBase.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchErrorBase.swift similarity index 95% rename from clients/algoliasearch-client-swift/Sources/Insights/Models/ErrorBase.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchErrorBase.swift index 29817fdeb5c..8d4885487ff 100644 --- a/clients/algoliasearch-client-swift/Sources/Insights/Models/ErrorBase.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchErrorBase.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Error. -public struct ErrorBase: Codable, JSONEncodable, Hashable { +public struct SearchErrorBase: Codable, JSONEncodable, Hashable { public var message: String? public init(message: String? = nil) { diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ExactOnSingleWordQuery.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchExactOnSingleWordQuery.swift similarity index 92% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/ExactOnSingleWordQuery.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchExactOnSingleWordQuery.swift index fcc698debe5..97326728d02 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/ExactOnSingleWordQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchExactOnSingleWordQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Determines how the [Exact ranking criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes) /// is computed when the search query has only one word. <dl> @@ -15,7 +16,7 @@ import Foundation /// found in the attribute value. The query word must have at least 3 characters and must not be a stop word. /// </dd> </dl> If `exactOnSingleWordQuery` is `word`, only exact matches will be /// highlighted, partial and prefix matches won't. -public enum ExactOnSingleWordQuery: String, Codable, CaseIterable { +public enum SearchExactOnSingleWordQuery: String, Codable, CaseIterable { case attribute case `none` case word diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Exhaustive.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchExhaustive.swift similarity index 96% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Exhaustive.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchExhaustive.swift index f7c16744f47..889ba7d46ce 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Exhaustive.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchExhaustive.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Whether certain properties of the search response are calculated exhaustive (exact) or approximated. -public struct Exhaustive: Codable, JSONEncodable, Hashable { +public struct SearchExhaustive: Codable, JSONEncodable, Hashable { /// Whether the facet count is exhaustive (`true`) or approximate (`false`). See the [related discussion](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-). public var facetsCount: Bool? /// The value is `false` if not all facet values are retrieved. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/FacetFilters.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacetFilters.swift similarity index 70% rename from clients/algoliasearch-client-swift/Sources/Search/Models/FacetFilters.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacetFilters.swift index 01e476bddd4..d4b8bd0eadd 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/FacetFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacetFilters.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filter the search by facet values, so that only records with the same facet values are retrieved. **Prefer using /// the `filters` parameter, which supports all filter types and combinations with boolean operators.** - @@ -11,16 +12,16 @@ import Foundation /// filter3]` is interpreted as `filter1 OR filter2 AND filter3`. - `facet:-value` is /// interpreted as `NOT facet:value`. While it's best to avoid attributes that start with a /// `-`, you can still filter them by escaping with a backslash: `facet:\\-value`. -public enum FacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum SearchFacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) - case arrayOfMixedSearchFilters([MixedSearchFilters]) + case arrayOfSearchMixedSearchFilters([SearchMixedSearchFilters]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .string(value): try container.encode(value) - case let .arrayOfMixedSearchFilters(value): + case let .arrayOfSearchMixedSearchFilters(value): try container.encode(value) } } @@ -29,12 +30,15 @@ public enum FacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { let container = try decoder.singleValueContainer() if let value = try? container.decode(String.self) { self = .string(value) - } else if let value = try? container.decode([MixedSearchFilters].self) { - self = .arrayOfMixedSearchFilters(value) + } else if let value = try? container.decode([SearchMixedSearchFilters].self) { + self = .arrayOfSearchMixedSearchFilters(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of FacetFilters") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchFacetFilters" + ) ) } } @@ -43,8 +47,8 @@ public enum FacetFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { switch self { case let .string(value): value as String - case let .arrayOfMixedSearchFilters(value): - value as [MixedSearchFilters] + case let .arrayOfSearchMixedSearchFilters(value): + value as [SearchMixedSearchFilters] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/FacetOrdering.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacetOrdering.swift similarity index 73% rename from clients/algoliasearch-client-swift/Sources/Search/Models/FacetOrdering.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacetOrdering.swift index ddea53d13e4..4e4d8e69667 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/FacetOrdering.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacetOrdering.swift @@ -1,17 +1,18 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Order of facet names and facet values in your UI. -public struct FacetOrdering: Codable, JSONEncodable, Hashable { - public var facets: Facets? +public struct SearchFacetOrdering: Codable, JSONEncodable, Hashable { + public var facets: SearchFacets? /// Order of facet values. One object for each facet. - public var values: [String: Value]? + public var values: [String: SearchValue]? - public init(facets: Facets? = nil, values: [String: Value]? = nil) { + public init(facets: SearchFacets? = nil, values: [String: SearchValue]? = nil) { self.facets = facets self.values = values } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Facets.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacets.swift similarity index 88% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Facets.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacets.swift index 9a07db00c77..159dcc98671 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Facets.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacets.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Order of facet names. -public struct Facets: Codable, JSONEncodable, Hashable { +public struct SearchFacets: Codable, JSONEncodable, Hashable { /// Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at /// the top of the list. public var order: [String]? diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/FacetsStats.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacetsStats.swift similarity index 91% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/FacetsStats.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacetsStats.swift index 19a4d749474..917afba389d 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/FacetsStats.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchFacetsStats.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct FacetsStats: Codable, JSONEncodable, Hashable { +public struct SearchFacetsStats: Codable, JSONEncodable, Hashable { /// Minimum value in the results. public var min: Double? /// Maximum value in the results. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetValuesRequest.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetValuesRequest.swift index ac7b9a3953e..d4a754d5afc 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetValuesRequest.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetValuesRequest.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchForFacetValuesRequest: Codable, JSONEncodable, Hashable { static let maxFacetHitsRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetValuesResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetValuesResponse.swift index 9afb9ff38c3..5be73cd7a48 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetValuesResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetValuesResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchForFacetValuesResponse: Codable, JSONEncodable, Hashable { /// Matching facet values. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacets.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacets.swift index 7cc6dd55078..5b04a5af80b 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacets.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacets.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchForFacets: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( @@ -86,10 +87,10 @@ public struct SearchForFacets: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: SearchFacetFilters? + public var optionalFilters: SearchOptionalFilters? + public var numericFilters: SearchNumericFilters? + public var tagFilters: SearchTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -116,8 +117,8 @@ public struct SearchForFacets: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: SearchAroundRadius? + public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -215,7 +216,7 @@ public struct SearchForFacets: Codable, JSONEncodable, Hashable { public var minWordSizefor1Typo: Int? /// Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). public var minWordSizefor2Typos: Int? - public var typoTolerance: TypoTolerance? + public var typoTolerance: SearchTypoTolerance? /// Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant /// matches when searching in large sets of similar numbers. public var allowTyposOnNumericTokens: Bool? @@ -226,8 +227,8 @@ public struct SearchForFacets: Codable, JSONEncodable, Hashable { /// of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding /// synonyms if your attributes have intentional unusual spellings that might look like typos. public var disableTypoToleranceOnAttributes: [String]? - public var ignorePlurals: IgnorePlurals? - public var removeStopWords: RemoveStopWords? + public var ignorePlurals: SearchIgnorePlurals? + public var removeStopWords: SearchRemoveStopWords? /// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For /// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep /// their diacritics. @@ -248,10 +249,10 @@ public struct SearchForFacets: Codable, JSONEncodable, Hashable { public var enableRules: Bool? /// Whether to enable Personalization. public var enablePersonalization: Bool? - public var queryType: QueryType? - public var removeWordsIfNoResults: RemoveWordsIfNoResults? - public var mode: Mode? - public var semanticSearch: SemanticSearch? + public var queryType: SearchQueryType? + public var removeWordsIfNoResults: SearchRemoveWordsIfNoResults? + public var mode: SearchMode? + public var semanticSearch: SearchSemanticSearch? /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? @@ -273,20 +274,20 @@ public struct SearchForFacets: Codable, JSONEncodable, Hashable { /// product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on /// other attributes. This reduces the impact of individual attributes with a lot of content on ranking. public var disableExactOnAttributes: [String]? - public var exactOnSingleWordQuery: ExactOnSingleWordQuery? + public var exactOnSingleWordQuery: SearchExactOnSingleWordQuery? /// Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
///
ignorePlurals
Plurals and similar declensions added by the `ignorePlurals` setting /// are considered exact matches.
singleWordSynonym
Single-word synonyms, such as /// \"NY/NYC\" are considered exact matches.
multiWordsSynonym
Multi-word synonyms, /// such as \"NY/New York\" are considered exact matches.
. - public var alternativesAsExact: [AlternativesAsExact]? + public var alternativesAsExact: [SearchAlternativesAsExact]? /// Advanced search syntax features you want to support.
exactPhrase
Phrases in /// quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact /// string \"iPhone case\".
excludeWords
Query words prefixed with a `-` must not /// occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". ///
This setting only has an effect if `advancedSyntax` is true. - public var advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? - public var distinct: Distinct? + public var advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? + public var distinct: SearchDistinct? /// Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted /// even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records /// matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are @@ -319,11 +320,11 @@ public struct SearchForFacets: Codable, JSONEncodable, Hashable { /// matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching /// attribute is determined by the order in the `searchableAttributes` setting. public var attributeCriteriaComputedByMinProximity: Bool? - public var renderingContent: RenderingContent? + public var renderingContent: SearchRenderingContent? /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. public var enableReRanking: Bool? - public var reRankingApplyFilter: ReRankingApplyFilter? + public var reRankingApplyFilter: SearchReRankingApplyFilter? /// Facet name. public var facet: String /// Index name. @@ -337,10 +338,10 @@ public struct SearchForFacets: Codable, JSONEncodable, Hashable { query: String? = nil, similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: SearchFacetFilters? = nil, + optionalFilters: SearchOptionalFilters? = nil, + numericFilters: SearchNumericFilters? = nil, + tagFilters: SearchTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -350,8 +351,8 @@ public struct SearchForFacets: Codable, JSONEncodable, Hashable { length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: SearchAroundRadius? = nil, + aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, @@ -379,27 +380,27 @@ public struct SearchForFacets: Codable, JSONEncodable, Hashable { hitsPerPage: Int? = nil, minWordSizefor1Typo: Int? = nil, minWordSizefor2Typos: Int? = nil, - typoTolerance: TypoTolerance? = nil, + typoTolerance: SearchTypoTolerance? = nil, allowTyposOnNumericTokens: Bool? = nil, disableTypoToleranceOnAttributes: [String]? = nil, - ignorePlurals: IgnorePlurals? = nil, - removeStopWords: RemoveStopWords? = nil, + ignorePlurals: SearchIgnorePlurals? = nil, + removeStopWords: SearchRemoveStopWords? = nil, keepDiacriticsOnCharacters: String? = nil, queryLanguages: [String]? = nil, decompoundQuery: Bool? = nil, enableRules: Bool? = nil, enablePersonalization: Bool? = nil, - queryType: QueryType? = nil, - removeWordsIfNoResults: RemoveWordsIfNoResults? = nil, - mode: Mode? = nil, - semanticSearch: SemanticSearch? = nil, + queryType: SearchQueryType? = nil, + removeWordsIfNoResults: SearchRemoveWordsIfNoResults? = nil, + mode: SearchMode? = nil, + semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, optionalWords: [String]? = nil, disableExactOnAttributes: [String]? = nil, - exactOnSingleWordQuery: ExactOnSingleWordQuery? = nil, - alternativesAsExact: [AlternativesAsExact]? = nil, - advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? = nil, - distinct: Distinct? = nil, + exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, + alternativesAsExact: [SearchAlternativesAsExact]? = nil, + advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? = nil, + distinct: SearchDistinct? = nil, replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, @@ -407,9 +408,9 @@ public struct SearchForFacets: Codable, JSONEncodable, Hashable { maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, - renderingContent: RenderingContent? = nil, + renderingContent: SearchRenderingContent? = nil, enableReRanking: Bool? = nil, - reRankingApplyFilter: ReRankingApplyFilter? = nil, + reRankingApplyFilter: SearchReRankingApplyFilter? = nil, facet: String, indexName: String, facetQuery: String? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetsOptions.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetsOptions.swift index 1d239f499bb..d2197e1dd0d 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetsOptions.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForFacetsOptions.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchForFacetsOptions: Codable, JSONEncodable, Hashable { static let maxFacetHitsRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHits.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHits.swift index 1e87acbc49f..e060ea05ffd 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHits.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHits.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchForHits: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( @@ -86,10 +87,10 @@ public struct SearchForHits: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: SearchFacetFilters? + public var optionalFilters: SearchOptionalFilters? + public var numericFilters: SearchNumericFilters? + public var tagFilters: SearchTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -116,8 +117,8 @@ public struct SearchForHits: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: SearchAroundRadius? + public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -215,7 +216,7 @@ public struct SearchForHits: Codable, JSONEncodable, Hashable { public var minWordSizefor1Typo: Int? /// Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). public var minWordSizefor2Typos: Int? - public var typoTolerance: TypoTolerance? + public var typoTolerance: SearchTypoTolerance? /// Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant /// matches when searching in large sets of similar numbers. public var allowTyposOnNumericTokens: Bool? @@ -226,8 +227,8 @@ public struct SearchForHits: Codable, JSONEncodable, Hashable { /// of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding /// synonyms if your attributes have intentional unusual spellings that might look like typos. public var disableTypoToleranceOnAttributes: [String]? - public var ignorePlurals: IgnorePlurals? - public var removeStopWords: RemoveStopWords? + public var ignorePlurals: SearchIgnorePlurals? + public var removeStopWords: SearchRemoveStopWords? /// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For /// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep /// their diacritics. @@ -248,10 +249,10 @@ public struct SearchForHits: Codable, JSONEncodable, Hashable { public var enableRules: Bool? /// Whether to enable Personalization. public var enablePersonalization: Bool? - public var queryType: QueryType? - public var removeWordsIfNoResults: RemoveWordsIfNoResults? - public var mode: Mode? - public var semanticSearch: SemanticSearch? + public var queryType: SearchQueryType? + public var removeWordsIfNoResults: SearchRemoveWordsIfNoResults? + public var mode: SearchMode? + public var semanticSearch: SearchSemanticSearch? /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? @@ -273,20 +274,20 @@ public struct SearchForHits: Codable, JSONEncodable, Hashable { /// product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on /// other attributes. This reduces the impact of individual attributes with a lot of content on ranking. public var disableExactOnAttributes: [String]? - public var exactOnSingleWordQuery: ExactOnSingleWordQuery? + public var exactOnSingleWordQuery: SearchExactOnSingleWordQuery? /// Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
///
ignorePlurals
Plurals and similar declensions added by the `ignorePlurals` setting /// are considered exact matches.
singleWordSynonym
Single-word synonyms, such as /// \"NY/NYC\" are considered exact matches.
multiWordsSynonym
Multi-word synonyms, /// such as \"NY/New York\" are considered exact matches.
. - public var alternativesAsExact: [AlternativesAsExact]? + public var alternativesAsExact: [SearchAlternativesAsExact]? /// Advanced search syntax features you want to support.
exactPhrase
Phrases in /// quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact /// string \"iPhone case\".
excludeWords
Query words prefixed with a `-` must not /// occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". ///
This setting only has an effect if `advancedSyntax` is true. - public var advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? - public var distinct: Distinct? + public var advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? + public var distinct: SearchDistinct? /// Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted /// even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records /// matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are @@ -319,11 +320,11 @@ public struct SearchForHits: Codable, JSONEncodable, Hashable { /// matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching /// attribute is determined by the order in the `searchableAttributes` setting. public var attributeCriteriaComputedByMinProximity: Bool? - public var renderingContent: RenderingContent? + public var renderingContent: SearchRenderingContent? /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. public var enableReRanking: Bool? - public var reRankingApplyFilter: ReRankingApplyFilter? + public var reRankingApplyFilter: SearchReRankingApplyFilter? /// Index name. public var indexName: String public var type: SearchTypeDefault? @@ -333,10 +334,10 @@ public struct SearchForHits: Codable, JSONEncodable, Hashable { query: String? = nil, similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: SearchFacetFilters? = nil, + optionalFilters: SearchOptionalFilters? = nil, + numericFilters: SearchNumericFilters? = nil, + tagFilters: SearchTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -346,8 +347,8 @@ public struct SearchForHits: Codable, JSONEncodable, Hashable { length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: SearchAroundRadius? = nil, + aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, @@ -375,27 +376,27 @@ public struct SearchForHits: Codable, JSONEncodable, Hashable { hitsPerPage: Int? = nil, minWordSizefor1Typo: Int? = nil, minWordSizefor2Typos: Int? = nil, - typoTolerance: TypoTolerance? = nil, + typoTolerance: SearchTypoTolerance? = nil, allowTyposOnNumericTokens: Bool? = nil, disableTypoToleranceOnAttributes: [String]? = nil, - ignorePlurals: IgnorePlurals? = nil, - removeStopWords: RemoveStopWords? = nil, + ignorePlurals: SearchIgnorePlurals? = nil, + removeStopWords: SearchRemoveStopWords? = nil, keepDiacriticsOnCharacters: String? = nil, queryLanguages: [String]? = nil, decompoundQuery: Bool? = nil, enableRules: Bool? = nil, enablePersonalization: Bool? = nil, - queryType: QueryType? = nil, - removeWordsIfNoResults: RemoveWordsIfNoResults? = nil, - mode: Mode? = nil, - semanticSearch: SemanticSearch? = nil, + queryType: SearchQueryType? = nil, + removeWordsIfNoResults: SearchRemoveWordsIfNoResults? = nil, + mode: SearchMode? = nil, + semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, optionalWords: [String]? = nil, disableExactOnAttributes: [String]? = nil, - exactOnSingleWordQuery: ExactOnSingleWordQuery? = nil, - alternativesAsExact: [AlternativesAsExact]? = nil, - advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? = nil, - distinct: Distinct? = nil, + exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, + alternativesAsExact: [SearchAlternativesAsExact]? = nil, + advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? = nil, + distinct: SearchDistinct? = nil, replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, @@ -403,9 +404,9 @@ public struct SearchForHits: Codable, JSONEncodable, Hashable { maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, - renderingContent: RenderingContent? = nil, + renderingContent: SearchRenderingContent? = nil, enableReRanking: Bool? = nil, - reRankingApplyFilter: ReRankingApplyFilter? = nil, + reRankingApplyFilter: SearchReRankingApplyFilter? = nil, indexName: String, type: SearchTypeDefault? = nil ) { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHitsOptions.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHitsOptions.swift index 6af3b78067d..0ca58ea8b3f 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHitsOptions.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchForHitsOptions.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchForHitsOptions: Codable, JSONEncodable, Hashable { /// Index name. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchHighlightResult.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchHighlightResult.swift new file mode 100644 index 00000000000..b518677dc16 --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchHighlightResult.swift @@ -0,0 +1,55 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +public enum SearchHighlightResult: Codable, JSONEncodable, AbstractEncodable, Hashable { + case searchHighlightResultOption(SearchHighlightResultOption) + case arrayOfSearchHighlightResultOption([SearchHighlightResultOption]) + case dictionaryOfStringToSearchHighlightResultOption([String: SearchHighlightResultOption]) + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .searchHighlightResultOption(value): + try container.encode(value) + case let .arrayOfSearchHighlightResultOption(value): + try container.encode(value) + case let .dictionaryOfStringToSearchHighlightResultOption(value): + try container.encode(value) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(SearchHighlightResultOption.self) { + self = .searchHighlightResultOption(value) + } else if let value = try? container.decode([SearchHighlightResultOption].self) { + self = .arrayOfSearchHighlightResultOption(value) + } else if let value = try? container.decode([String: SearchHighlightResultOption].self) { + self = .dictionaryOfStringToSearchHighlightResultOption(value) + } else { + throw DecodingError.typeMismatch( + Self.Type.self, + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchHighlightResult" + ) + ) + } + } + + public func GetActualInstance() -> Encodable { + switch self { + case let .searchHighlightResultOption(value): + value as SearchHighlightResultOption + case let .arrayOfSearchHighlightResultOption(value): + value as [SearchHighlightResultOption] + case let .dictionaryOfStringToSearchHighlightResultOption(value): + value as [String: SearchHighlightResultOption] + } + } +} diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/HighlightResultOption.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchHighlightResultOption.swift similarity index 82% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/HighlightResultOption.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchHighlightResultOption.swift index 6f959bec698..a7bbabbb21b 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/HighlightResultOption.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchHighlightResultOption.swift @@ -1,21 +1,22 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Surround words that match the query with HTML tags for highlighting. -public struct HighlightResultOption: Codable, JSONEncodable, Hashable { +public struct SearchHighlightResultOption: Codable, JSONEncodable, Hashable { /// Highlighted attribute value, including HTML tags. public var value: String - public var matchLevel: MatchLevel + public var matchLevel: SearchMatchLevel /// List of matched words from the search query. public var matchedWords: [String] /// Whether the entire attribute value is highlighted. public var fullyHighlighted: Bool? - public init(value: String, matchLevel: MatchLevel, matchedWords: [String], fullyHighlighted: Bool? = nil) { + public init(value: String, matchLevel: SearchMatchLevel, matchedWords: [String], fullyHighlighted: Bool? = nil) { self.value = value self.matchLevel = matchLevel self.matchedWords = matchedWords diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchHits.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchHits.swift index 97da2718a84..9bfc38bf6b4 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchHits.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchHits.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchHits: Codable, JSONEncodable, Hashable { /// Search results (hits). Hits are records from your index that match the search criteria, augmented with diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/IgnorePlurals.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchIgnorePlurals.swift similarity index 81% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/IgnorePlurals.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchIgnorePlurals.swift index 97e842a3b47..e7d098fc9f9 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/IgnorePlurals.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchIgnorePlurals.swift @@ -1,13 +1,14 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Treat singular, plurals, and other forms of declensions as equivalent. You should only use this feature for the /// languages used in your index. -public enum IgnorePlurals: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum SearchIgnorePlurals: Codable, JSONEncodable, AbstractEncodable, Hashable { case bool(Bool) case arrayOfString([String]) @@ -30,7 +31,10 @@ public enum IgnorePlurals: Codable, JSONEncodable, AbstractEncodable, Hashable { } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of IgnorePlurals") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchIgnorePlurals" + ) ) } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/IndexSettingsAsSearchParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchIndexSettingsAsSearchParams.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/IndexSettingsAsSearchParams.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchIndexSettingsAsSearchParams.swift index 651dc9ec96a..9ead3171256 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/IndexSettingsAsSearchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchIndexSettingsAsSearchParams.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { +public struct SearchIndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { static let hitsPerPageRule = NumericRule( minimum: 1, exclusiveMinimum: false, @@ -89,7 +90,7 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { public var minWordSizefor1Typo: Int? /// Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). public var minWordSizefor2Typos: Int? - public var typoTolerance: TypoTolerance? + public var typoTolerance: SearchTypoTolerance? /// Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant /// matches when searching in large sets of similar numbers. public var allowTyposOnNumericTokens: Bool? @@ -100,8 +101,8 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { /// of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding /// synonyms if your attributes have intentional unusual spellings that might look like typos. public var disableTypoToleranceOnAttributes: [String]? - public var ignorePlurals: IgnorePlurals? - public var removeStopWords: RemoveStopWords? + public var ignorePlurals: SearchIgnorePlurals? + public var removeStopWords: SearchRemoveStopWords? /// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For /// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep /// their diacritics. @@ -122,10 +123,10 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { public var enableRules: Bool? /// Whether to enable Personalization. public var enablePersonalization: Bool? - public var queryType: QueryType? - public var removeWordsIfNoResults: RemoveWordsIfNoResults? - public var mode: Mode? - public var semanticSearch: SemanticSearch? + public var queryType: SearchQueryType? + public var removeWordsIfNoResults: SearchRemoveWordsIfNoResults? + public var mode: SearchMode? + public var semanticSearch: SearchSemanticSearch? /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? @@ -147,20 +148,20 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { /// product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on /// other attributes. This reduces the impact of individual attributes with a lot of content on ranking. public var disableExactOnAttributes: [String]? - public var exactOnSingleWordQuery: ExactOnSingleWordQuery? + public var exactOnSingleWordQuery: SearchExactOnSingleWordQuery? /// Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
///
ignorePlurals
Plurals and similar declensions added by the `ignorePlurals` setting /// are considered exact matches.
singleWordSynonym
Single-word synonyms, such as /// \"NY/NYC\" are considered exact matches.
multiWordsSynonym
Multi-word synonyms, /// such as \"NY/New York\" are considered exact matches.
. - public var alternativesAsExact: [AlternativesAsExact]? + public var alternativesAsExact: [SearchAlternativesAsExact]? /// Advanced search syntax features you want to support.
exactPhrase
Phrases in /// quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact /// string \"iPhone case\".
excludeWords
Query words prefixed with a `-` must not /// occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". ///
This setting only has an effect if `advancedSyntax` is true. - public var advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? - public var distinct: Distinct? + public var advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? + public var distinct: SearchDistinct? /// Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted /// even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records /// matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are @@ -193,11 +194,11 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { /// matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching /// attribute is determined by the order in the `searchableAttributes` setting. public var attributeCriteriaComputedByMinProximity: Bool? - public var renderingContent: RenderingContent? + public var renderingContent: SearchRenderingContent? /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. public var enableReRanking: Bool? - public var reRankingApplyFilter: ReRankingApplyFilter? + public var reRankingApplyFilter: SearchReRankingApplyFilter? public init( attributesToRetrieve: [String]? = nil, @@ -213,27 +214,27 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { hitsPerPage: Int? = nil, minWordSizefor1Typo: Int? = nil, minWordSizefor2Typos: Int? = nil, - typoTolerance: TypoTolerance? = nil, + typoTolerance: SearchTypoTolerance? = nil, allowTyposOnNumericTokens: Bool? = nil, disableTypoToleranceOnAttributes: [String]? = nil, - ignorePlurals: IgnorePlurals? = nil, - removeStopWords: RemoveStopWords? = nil, + ignorePlurals: SearchIgnorePlurals? = nil, + removeStopWords: SearchRemoveStopWords? = nil, keepDiacriticsOnCharacters: String? = nil, queryLanguages: [String]? = nil, decompoundQuery: Bool? = nil, enableRules: Bool? = nil, enablePersonalization: Bool? = nil, - queryType: QueryType? = nil, - removeWordsIfNoResults: RemoveWordsIfNoResults? = nil, - mode: Mode? = nil, - semanticSearch: SemanticSearch? = nil, + queryType: SearchQueryType? = nil, + removeWordsIfNoResults: SearchRemoveWordsIfNoResults? = nil, + mode: SearchMode? = nil, + semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, optionalWords: [String]? = nil, disableExactOnAttributes: [String]? = nil, - exactOnSingleWordQuery: ExactOnSingleWordQuery? = nil, - alternativesAsExact: [AlternativesAsExact]? = nil, - advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? = nil, - distinct: Distinct? = nil, + exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, + alternativesAsExact: [SearchAlternativesAsExact]? = nil, + advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? = nil, + distinct: SearchDistinct? = nil, replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, @@ -241,9 +242,9 @@ public struct IndexSettingsAsSearchParams: Codable, JSONEncodable, Hashable { maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, - renderingContent: RenderingContent? = nil, + renderingContent: SearchRenderingContent? = nil, enableReRanking: Bool? = nil, - reRankingApplyFilter: ReRankingApplyFilter? = nil + reRankingApplyFilter: SearchReRankingApplyFilter? = nil ) { self.attributesToRetrieve = attributesToRetrieve self.ranking = ranking diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Languages.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchLanguages.swift similarity index 90% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Languages.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchLanguages.swift index f237e2c8415..41b1a6fca35 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Languages.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchLanguages.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Dictionary language. -public struct Languages: Codable, JSONEncodable, Hashable { +public struct SearchLanguages: Codable, JSONEncodable, Hashable { public var plurals: DictionaryLanguage? public var stopwords: DictionaryLanguage? public var compounds: DictionaryLanguage? diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/MatchLevel.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMatchLevel.swift similarity index 74% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/MatchLevel.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchMatchLevel.swift index 7b1c3fd2bae..03be1ae7d7b 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/MatchLevel.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMatchLevel.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Whether the whole query string matches or only a part. -public enum MatchLevel: String, Codable, CaseIterable { +public enum SearchMatchLevel: String, Codable, CaseIterable { case `none` case partial case full diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/MatchedGeoLocation.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMatchedGeoLocation.swift similarity index 90% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/MatchedGeoLocation.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchMatchedGeoLocation.swift index 90dc2f9505e..c994fde4b15 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/MatchedGeoLocation.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMatchedGeoLocation.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct MatchedGeoLocation: Codable, JSONEncodable, Hashable { +public struct SearchMatchedGeoLocation: Codable, JSONEncodable, Hashable { /// Latitude of the matched location. public var lat: Double? /// Longitude of the matched location. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMethodParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMethodParams.swift index f2e223c0c9c..77eacc36cb7 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMethodParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMethodParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchMethodParams: Codable, JSONEncodable, Hashable { public var requests: [SearchQuery] diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/MixedSearchFilters.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMixedSearchFilters.swift similarity index 89% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/MixedSearchFilters.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchMixedSearchFilters.swift index a271b711500..7db786afb46 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/MixedSearchFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMixedSearchFilters.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public enum MixedSearchFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum SearchMixedSearchFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) case arrayOfString([String]) @@ -30,7 +31,7 @@ public enum MixedSearchFilters: Codable, JSONEncodable, AbstractEncodable, Hasha Self.Type.self, .init( codingPath: decoder.codingPath, - debugDescription: "Unable to decode instance of MixedSearchFilters" + debugDescription: "Unable to decode instance of SearchMixedSearchFilters" ) ) } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Mode.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMode.swift similarity index 80% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Mode.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchMode.swift index 7b5a30f0f7e..7019ce4d7c3 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Mode.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchMode.swift @@ -1,13 +1,14 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Search mode the index will use to query for results. This setting only applies to indices, for which Algolia /// enabled NeuralSearch for you. -public enum Mode: String, Codable, CaseIterable { +public enum SearchMode: String, Codable, CaseIterable { case neuralSearch case keywordSearch } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/NumericFilters.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchNumericFilters.swift similarity index 69% rename from clients/algoliasearch-client-swift/Sources/Search/Models/NumericFilters.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchNumericFilters.swift index 287190ad67b..32c9ee0152a 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/NumericFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchNumericFilters.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filter by numeric facets. **Prefer using the `filters` parameter, which supports all filter types and /// combinations with boolean operators.** You can use numeric comparison operators: `<`, @@ -11,16 +12,16 @@ import Foundation /// Comparsions are precise up to 3 decimals. You can also provide ranges: `facet:<lower> TO /// <upper>`. The range includes the lower and upper boundaries. The same combination rules apply as for /// `facetFilters`. -public enum NumericFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum SearchNumericFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) - case arrayOfMixedSearchFilters([MixedSearchFilters]) + case arrayOfSearchMixedSearchFilters([SearchMixedSearchFilters]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .string(value): try container.encode(value) - case let .arrayOfMixedSearchFilters(value): + case let .arrayOfSearchMixedSearchFilters(value): try container.encode(value) } } @@ -29,12 +30,15 @@ public enum NumericFilters: Codable, JSONEncodable, AbstractEncodable, Hashable let container = try decoder.singleValueContainer() if let value = try? container.decode(String.self) { self = .string(value) - } else if let value = try? container.decode([MixedSearchFilters].self) { - self = .arrayOfMixedSearchFilters(value) + } else if let value = try? container.decode([SearchMixedSearchFilters].self) { + self = .arrayOfSearchMixedSearchFilters(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of NumericFilters") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchNumericFilters" + ) ) } } @@ -43,8 +47,8 @@ public enum NumericFilters: Codable, JSONEncodable, AbstractEncodable, Hashable switch self { case let .string(value): value as String - case let .arrayOfMixedSearchFilters(value): - value as [MixedSearchFilters] + case let .arrayOfSearchMixedSearchFilters(value): + value as [SearchMixedSearchFilters] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/OptionalFilters.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchOptionalFilters.swift similarity index 68% rename from clients/algoliasearch-client-swift/Sources/Search/Models/OptionalFilters.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchOptionalFilters.swift index 3c02fabf5cf..a80fbd35898 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/OptionalFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchOptionalFilters.swift @@ -1,25 +1,26 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filters to promote or demote records in the search results. Optional filters work like facet filters, but they /// don't exclude records from the search results. Records that match the optional filter rank before records that /// don't match. If you're using a negative filter `facet:-value`, matching records rank after records /// that don't match. - Optional filters don't work on virtual replicas. - Optional filters are applied _after_ /// sort-by attributes. - Optional filters don't work with numeric attributes. -public enum OptionalFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum SearchOptionalFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) - case arrayOfMixedSearchFilters([MixedSearchFilters]) + case arrayOfSearchMixedSearchFilters([SearchMixedSearchFilters]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .string(value): try container.encode(value) - case let .arrayOfMixedSearchFilters(value): + case let .arrayOfSearchMixedSearchFilters(value): try container.encode(value) } } @@ -28,12 +29,15 @@ public enum OptionalFilters: Codable, JSONEncodable, AbstractEncodable, Hashable let container = try decoder.singleValueContainer() if let value = try? container.decode(String.self) { self = .string(value) - } else if let value = try? container.decode([MixedSearchFilters].self) { - self = .arrayOfMixedSearchFilters(value) + } else if let value = try? container.decode([SearchMixedSearchFilters].self) { + self = .arrayOfSearchMixedSearchFilters(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of OptionalFilters") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchOptionalFilters" + ) ) } } @@ -42,8 +46,8 @@ public enum OptionalFilters: Codable, JSONEncodable, AbstractEncodable, Hashable switch self { case let .string(value): value as String - case let .arrayOfMixedSearchFilters(value): - value as [MixedSearchFilters] + case let .arrayOfSearchMixedSearchFilters(value): + value as [SearchMixedSearchFilters] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParams.swift index 79ba3c8b577..29a86326852 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParams.swift @@ -1,44 +1,45 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public enum SearchParams: Codable, JSONEncodable, AbstractEncodable, Hashable { - case searchParamsObject(SearchParamsObject) - case searchParamsString(SearchParamsString) +/// Parameters to apply to this search. You can use all search parameters, plus special +/// `automaticFacetFilters`, `automaticOptionalFacetFilters`, and `query`. +public struct SearchParams: Codable, JSONEncodable, Hashable { + public var query: SearchConsequenceQuery? + public var automaticFacetFilters: SearchAutomaticFacetFilters? + public var automaticOptionalFacetFilters: SearchAutomaticFacetFilters? + public var renderingContent: SearchRenderingContent? - public func encode(to encoder: Encoder) throws { - var container = encoder.singleValueContainer() - switch self { - case let .searchParamsObject(value): - try container.encode(value) - case let .searchParamsString(value): - try container.encode(value) - } + public init( + query: SearchConsequenceQuery? = nil, + automaticFacetFilters: SearchAutomaticFacetFilters? = nil, + automaticOptionalFacetFilters: SearchAutomaticFacetFilters? = nil, + renderingContent: SearchRenderingContent? = nil + ) { + self.query = query + self.automaticFacetFilters = automaticFacetFilters + self.automaticOptionalFacetFilters = automaticOptionalFacetFilters + self.renderingContent = renderingContent } - public init(from decoder: Decoder) throws { - let container = try decoder.singleValueContainer() - if let value = try? container.decode(SearchParamsObject.self) { - self = .searchParamsObject(value) - } else if let value = try? container.decode(SearchParamsString.self) { - self = .searchParamsString(value) - } else { - throw DecodingError.typeMismatch( - Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of SearchParams") - ) - } + public enum CodingKeys: String, CodingKey, CaseIterable { + case query + case automaticFacetFilters + case automaticOptionalFacetFilters + case renderingContent } - public func GetActualInstance() -> Encodable { - switch self { - case let .searchParamsObject(value): - value as SearchParamsObject - case let .searchParamsString(value): - value as SearchParamsString - } + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(self.query, forKey: .query) + try container.encodeIfPresent(self.automaticFacetFilters, forKey: .automaticFacetFilters) + try container.encodeIfPresent(self.automaticOptionalFacetFilters, forKey: .automaticOptionalFacetFilters) + try container.encodeIfPresent(self.renderingContent, forKey: .renderingContent) } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParamsString.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParamsString.swift index 95ec67c24fe..27cbbd2cdde 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParamsString.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParamsString.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchParamsString: Codable, JSONEncodable, Hashable { /// Search parameters as a URL-encoded query string. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Personalization.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchPersonalization.swift similarity index 90% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Personalization.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchPersonalization.swift index 8c2beaf1cf7..845ee8500b5 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Personalization.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchPersonalization.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct Personalization: Codable, JSONEncodable, Hashable { +public struct SearchPersonalization: Codable, JSONEncodable, Hashable { /// The score of the filters. public var filtersScore: Int? /// The score of the ranking. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchPromote.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchPromote.swift new file mode 100644 index 00000000000..a5c007da9d2 --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchPromote.swift @@ -0,0 +1,45 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +public enum SearchPromote: Codable, JSONEncodable, AbstractEncodable, Hashable { + case searchPromoteObjectID(SearchPromoteObjectID) + case searchPromoteObjectIDs(SearchPromoteObjectIDs) + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .searchPromoteObjectID(value): + try container.encode(value) + case let .searchPromoteObjectIDs(value): + try container.encode(value) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(SearchPromoteObjectID.self) { + self = .searchPromoteObjectID(value) + } else if let value = try? container.decode(SearchPromoteObjectIDs.self) { + self = .searchPromoteObjectIDs(value) + } else { + throw DecodingError.typeMismatch( + Self.Type.self, + .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of SearchPromote") + ) + } + } + + public func GetActualInstance() -> Encodable { + switch self { + case let .searchPromoteObjectID(value): + value as SearchPromoteObjectID + case let .searchPromoteObjectIDs(value): + value as SearchPromoteObjectIDs + } + } +} diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/PromoteObjectID.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchPromoteObjectID.swift similarity index 89% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/PromoteObjectID.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchPromoteObjectID.swift index b6c75eaaa89..8c1cc55dd76 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/PromoteObjectID.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchPromoteObjectID.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Record to promote. -public struct PromoteObjectID: Codable, JSONEncodable, Hashable { +public struct SearchPromoteObjectID: Codable, JSONEncodable, Hashable { /// Unique record identifier. public var objectID: String /// Position in the search results where you want to show the promoted records. diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/PromoteObjectIDs.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchPromoteObjectIDs.swift similarity index 90% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/PromoteObjectIDs.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchPromoteObjectIDs.swift index 8ee4febab54..94b66a15dc7 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/PromoteObjectIDs.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchPromoteObjectIDs.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Records to promote. -public struct PromoteObjectIDs: Codable, JSONEncodable, Hashable { +public struct SearchPromoteObjectIDs: Codable, JSONEncodable, Hashable { /// Object IDs of the records you want to promote. The records are placed as a group at the `position`. For /// example, if you want to promote four records to position `0`, they will be the first four search results. public var objectIDs: [String] diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchQuery.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchQuery.swift index 49794b8baf9..2782f933e3e 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchQuery.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum SearchQuery: Codable, JSONEncodable, AbstractEncodable, Hashable { case searchForFacets(SearchForFacets) diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/QueryType.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchQueryType.swift similarity index 88% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/QueryType.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchQueryType.swift index 75e915dbdb1..52feaf068e7 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/QueryType.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchQueryType.swift @@ -1,15 +1,16 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Determines if and how query words are interpreted as prefixes. By default, only the last query word is treated as /// prefix (`prefixLast`). To turn off prefix search, use `prefixNone`. Avoid `prefixAll`, /// which treats all query words as prefixes. This might lead to counterintuitive results and makes your search slower. /// For more information, see [Prefix searching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching/). -public enum QueryType: String, Codable, CaseIterable { +public enum SearchQueryType: String, Codable, CaseIterable { case prefixLast case prefixAll case prefixNone diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RankingInfo.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRankingInfo.swift similarity index 93% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/RankingInfo.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchRankingInfo.swift index a5eea03ca68..2ad35d46f34 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RankingInfo.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRankingInfo.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Object with detailed information about the record's ranking. -public struct RankingInfo: Codable, JSONEncodable, Hashable { +public struct SearchRankingInfo: Codable, JSONEncodable, Hashable { static let filtersRule = NumericRule( minimum: 0, exclusiveMinimum: false, @@ -72,8 +73,8 @@ public struct RankingInfo: Codable, JSONEncodable, Hashable { public var geoDistance: Int /// Precision used when computing the geo distance, in meters. public var geoPrecision: Int? - public var matchedGeoLocation: MatchedGeoLocation? - public var personalization: Personalization? + public var matchedGeoLocation: SearchMatchedGeoLocation? + public var personalization: SearchPersonalization? /// Number of exactly matched words. public var nbExactWords: Int /// Number of typos encountered when matching the record. @@ -94,8 +95,8 @@ public struct RankingInfo: Codable, JSONEncodable, Hashable { firstMatchedWord: Int, geoDistance: Int, geoPrecision: Int? = nil, - matchedGeoLocation: MatchedGeoLocation? = nil, - personalization: Personalization? = nil, + matchedGeoLocation: SearchMatchedGeoLocation? = nil, + personalization: SearchPersonalization? = nil, nbExactWords: Int, nbTypos: Int, promoted: Bool, diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/ReRankingApplyFilter.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchReRankingApplyFilter.swift similarity index 69% rename from clients/algoliasearch-client-swift/Sources/Search/Models/ReRankingApplyFilter.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchReRankingApplyFilter.swift index ce14641b152..8446299cf0f 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/ReRankingApplyFilter.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchReRankingApplyFilter.swift @@ -1,22 +1,23 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Restrict [Dynamic Re-ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/) to records that match these /// filters. -public enum ReRankingApplyFilter: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum SearchReRankingApplyFilter: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) - case arrayOfMixedSearchFilters([MixedSearchFilters]) + case arrayOfSearchMixedSearchFilters([SearchMixedSearchFilters]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .string(value): try container.encode(value) - case let .arrayOfMixedSearchFilters(value): + case let .arrayOfSearchMixedSearchFilters(value): try container.encode(value) } } @@ -25,14 +26,14 @@ public enum ReRankingApplyFilter: Codable, JSONEncodable, AbstractEncodable, Has let container = try decoder.singleValueContainer() if let value = try? container.decode(String.self) { self = .string(value) - } else if let value = try? container.decode([MixedSearchFilters].self) { - self = .arrayOfMixedSearchFilters(value) + } else if let value = try? container.decode([SearchMixedSearchFilters].self) { + self = .arrayOfSearchMixedSearchFilters(value) } else { throw DecodingError.typeMismatch( Self.Type.self, .init( codingPath: decoder.codingPath, - debugDescription: "Unable to decode instance of ReRankingApplyFilter" + debugDescription: "Unable to decode instance of SearchReRankingApplyFilter" ) ) } @@ -42,8 +43,8 @@ public enum ReRankingApplyFilter: Codable, JSONEncodable, AbstractEncodable, Has switch self { case let .string(value): value as String - case let .arrayOfMixedSearchFilters(value): - value as [MixedSearchFilters] + case let .arrayOfSearchMixedSearchFilters(value): + value as [SearchMixedSearchFilters] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Redirect.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRedirect.swift similarity index 75% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Redirect.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchRedirect.swift index 37f614103de..83946773f15 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Redirect.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRedirect.swift @@ -1,16 +1,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// [Redirect results to a /// URL](https://www.algolia.com/doc/guides/managing-results/rules/merchandising-and-promoting/how-to/redirects/). -public struct Redirect: Codable, JSONEncodable, Hashable { - public var index: [RedirectRuleIndexMetadata]? +public struct SearchRedirect: Codable, JSONEncodable, Hashable { + public var index: [SearchRedirectRuleIndexMetadata]? - public init(index: [RedirectRuleIndexMetadata]? = nil) { + public init(index: [SearchRedirectRuleIndexMetadata]? = nil) { self.index = index } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RedirectRuleIndexMetadata.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRedirectRuleIndexMetadata.swift similarity index 78% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/RedirectRuleIndexMetadata.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchRedirectRuleIndexMetadata.swift index a42a154696d..573a0bbb3c5 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RedirectRuleIndexMetadata.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRedirectRuleIndexMetadata.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct RedirectRuleIndexMetadata: Codable, JSONEncodable, Hashable { +public struct SearchRedirectRuleIndexMetadata: Codable, JSONEncodable, Hashable { /// Source index for the redirect rule. public var source: String /// Destination index for the redirect rule. @@ -14,9 +15,15 @@ public struct RedirectRuleIndexMetadata: Codable, JSONEncodable, Hashable { public var reason: String /// Redirect rule status. public var succeed: Bool - public var data: RedirectRuleIndexMetadataData + public var data: SearchRedirectRuleIndexMetadataData - public init(source: String, dest: String, reason: String, succeed: Bool, data: RedirectRuleIndexMetadataData) { + public init( + source: String, + dest: String, + reason: String, + succeed: Bool, + data: SearchRedirectRuleIndexMetadataData + ) { self.source = source self.dest = dest self.reason = reason diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/RedirectRuleIndexMetadataData.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRedirectRuleIndexMetadataData.swift similarity index 84% rename from clients/algoliasearch-client-swift/Sources/Search/Models/RedirectRuleIndexMetadataData.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchRedirectRuleIndexMetadataData.swift index 358dd692ec4..cf5edcf4e7c 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/RedirectRuleIndexMetadataData.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRedirectRuleIndexMetadataData.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Redirect rule data. -public struct RedirectRuleIndexMetadataData: Codable, JSONEncodable, Hashable { +public struct SearchRedirectRuleIndexMetadataData: Codable, JSONEncodable, Hashable { public var ruleObjectID: String public init(ruleObjectID: String) { diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RemoveStopWords.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRemoveStopWords.swift similarity index 83% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/RemoveStopWords.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchRemoveStopWords.swift index d3aa055ea45..fee27940154 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RemoveStopWords.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRemoveStopWords.swift @@ -1,14 +1,15 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Removes stop words from the search query. Stop words are common words like articles, conjunctions, prepositions, or /// pronouns that have little or no meaning on their own. In English, \"the\", \"a\", or /// \"and\" are stop words. You should only use this feature for the languages used in your index. -public enum RemoveStopWords: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum SearchRemoveStopWords: Codable, JSONEncodable, AbstractEncodable, Hashable { case bool(Bool) case arrayOfString([String]) @@ -31,7 +32,10 @@ public enum RemoveStopWords: Codable, JSONEncodable, AbstractEncodable, Hashable } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of RemoveStopWords") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchRemoveStopWords" + ) ) } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RemoveWordsIfNoResults.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRemoveWordsIfNoResults.swift similarity index 91% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/RemoveWordsIfNoResults.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchRemoveWordsIfNoResults.swift index 5142b14d0df..5ee570cb8e6 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RemoveWordsIfNoResults.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRemoveWordsIfNoResults.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Strategy for removing words from the query when it doesn't return any results. This helps to avoid returning /// empty search results. <dl> <dt><code>none</code></dt> <dd>No words are removed @@ -13,7 +14,7 @@ import Foundation /// the first (then second, then third) word as optional, until there are results or at most 5 words have been /// removed.</dd> <dt><code>allOptional</code></dt> <dd>Treat all words as /// optional.</dd> </dl> For more information, see [Remove words to improve results](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results/). -public enum RemoveWordsIfNoResults: String, Codable, CaseIterable { +public enum SearchRemoveWordsIfNoResults: String, Codable, CaseIterable { case `none` case lastWords case firstWords diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RenderingContent.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRenderingContent.swift similarity index 77% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/RenderingContent.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchRenderingContent.swift index b1b448340a0..e84043d66a6 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/RenderingContent.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRenderingContent.swift @@ -1,16 +1,17 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Extra data that can be used in the search UI. You can use this to control aspects of your search UI, such as, the /// order of facet names and values without changing your frontend code. -public struct RenderingContent: Codable, JSONEncodable, Hashable { - public var facetOrdering: FacetOrdering? +public struct SearchRenderingContent: Codable, JSONEncodable, Hashable { + public var facetOrdering: SearchFacetOrdering? - public init(facetOrdering: FacetOrdering? = nil) { + public init(facetOrdering: SearchFacetOrdering? = nil) { self.facetOrdering = facetOrdering } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResponse.swift index 7a0f3385d63..a6b5bfdf54d 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchResponse: Codable, JSONEncodable, Hashable { static let abTestVariantIDRule = NumericRule( @@ -40,7 +41,7 @@ public struct SearchResponse: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Distance from a central coordinate provided by `aroundLatLng`. public var automaticRadius: String? - public var exhaustive: Exhaustive? + public var exhaustive: SearchExhaustive? /// See the `facetsCount` field of the `exhaustive` object in the response. @available(*, deprecated, message: "This property is deprecated.") public var exhaustiveFacetsCount: Bool? @@ -53,7 +54,7 @@ public struct SearchResponse: Codable, JSONEncodable, Hashable { /// Facet counts. public var facets: [String: [String: Int]]? /// Statistics for numerical facets. - public var facetsStats: [String: FacetsStats]? + public var facetsStats: [String: SearchFacetsStats]? /// Number of hits per page. public var hitsPerPage: Int /// Index name used for the query. @@ -80,8 +81,8 @@ public struct SearchResponse: Codable, JSONEncodable, Hashable { public var processingTimingsMS: AnyCodable? /// Markup text indicating which parts of the original query have been removed to retrieve a non-empty result set. public var queryAfterRemoval: String? - public var redirect: Redirect? - public var renderingContent: RenderingContent? + public var redirect: SearchRedirect? + public var renderingContent: SearchRenderingContent? /// Time the server took to process the request, in milliseconds. public var serverTimeMS: Int? /// Host name of the server that processed the request. @@ -104,12 +105,12 @@ public struct SearchResponse: Codable, JSONEncodable, Hashable { abTestVariantID: Int? = nil, aroundLatLng: String? = nil, automaticRadius: String? = nil, - exhaustive: Exhaustive? = nil, + exhaustive: SearchExhaustive? = nil, exhaustiveFacetsCount: Bool? = nil, exhaustiveNbHits: Bool? = nil, exhaustiveTypo: Bool? = nil, facets: [String: [String: Int]]? = nil, - facetsStats: [String: FacetsStats]? = nil, + facetsStats: [String: SearchFacetsStats]? = nil, hitsPerPage: Int, index: String? = nil, indexUsed: String? = nil, @@ -122,8 +123,8 @@ public struct SearchResponse: Codable, JSONEncodable, Hashable { processingTimeMS: Int, processingTimingsMS: AnyCodable? = nil, queryAfterRemoval: String? = nil, - redirect: Redirect? = nil, - renderingContent: RenderingContent? = nil, + redirect: SearchRedirect? = nil, + renderingContent: SearchRenderingContent? = nil, serverTimeMS: Int? = nil, serverUsed: String? = nil, userData: AnyCodable? = nil, @@ -223,7 +224,7 @@ public struct SearchResponse: Codable, JSONEncodable, Hashable { self.automaticRadius = dictionary["automaticRadius"]?.value as? String - self.exhaustive = dictionary["exhaustive"]?.value as? Exhaustive + self.exhaustive = dictionary["exhaustive"]?.value as? SearchExhaustive self.exhaustiveFacetsCount = dictionary["exhaustiveFacetsCount"]?.value as? Bool @@ -233,7 +234,7 @@ public struct SearchResponse: Codable, JSONEncodable, Hashable { self.facets = dictionary["facets"]?.value as? [String: [String: Int]] - self.facetsStats = dictionary["facetsStats"]?.value as? [String: FacetsStats] + self.facetsStats = dictionary["facetsStats"]?.value as? [String: SearchFacetsStats] guard let hitsPerPage = dictionary["hitsPerPage"]?.value as? Int else { throw GenericError(description: "Failed to cast") @@ -269,9 +270,9 @@ public struct SearchResponse: Codable, JSONEncodable, Hashable { self.queryAfterRemoval = dictionary["queryAfterRemoval"]?.value as? String - self.redirect = dictionary["redirect"]?.value as? Redirect + self.redirect = dictionary["redirect"]?.value as? SearchRedirect - self.renderingContent = dictionary["renderingContent"]?.value as? RenderingContent + self.renderingContent = dictionary["renderingContent"]?.value as? SearchRenderingContent self.serverTimeMS = dictionary["serverTimeMS"]?.value as? Int @@ -355,12 +356,12 @@ public struct SearchResponse: Codable, JSONEncodable, Hashable { self.abTestVariantID = try container.decodeIfPresent(Int.self, forKey: .abTestVariantID) self.aroundLatLng = try container.decodeIfPresent(String.self, forKey: .aroundLatLng) self.automaticRadius = try container.decodeIfPresent(String.self, forKey: .automaticRadius) - self.exhaustive = try container.decodeIfPresent(Exhaustive.self, forKey: .exhaustive) + self.exhaustive = try container.decodeIfPresent(SearchExhaustive.self, forKey: .exhaustive) self.exhaustiveFacetsCount = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveFacetsCount) self.exhaustiveNbHits = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveNbHits) self.exhaustiveTypo = try container.decodeIfPresent(Bool.self, forKey: .exhaustiveTypo) self.facets = try container.decodeIfPresent([String: [String: Int]].self, forKey: .facets) - self.facetsStats = try container.decodeIfPresent([String: FacetsStats].self, forKey: .facetsStats) + self.facetsStats = try container.decodeIfPresent([String: SearchFacetsStats].self, forKey: .facetsStats) self.hitsPerPage = try container.decode(Int.self, forKey: .hitsPerPage) self.index = try container.decodeIfPresent(String.self, forKey: .index) self.indexUsed = try container.decodeIfPresent(String.self, forKey: .indexUsed) @@ -373,8 +374,8 @@ public struct SearchResponse: Codable, JSONEncodable, Hashable { self.processingTimeMS = try container.decode(Int.self, forKey: .processingTimeMS) self.processingTimingsMS = try container.decodeIfPresent(AnyCodable.self, forKey: .processingTimingsMS) self.queryAfterRemoval = try container.decodeIfPresent(String.self, forKey: .queryAfterRemoval) - self.redirect = try container.decodeIfPresent(Redirect.self, forKey: .redirect) - self.renderingContent = try container.decodeIfPresent(RenderingContent.self, forKey: .renderingContent) + self.redirect = try container.decodeIfPresent(SearchRedirect.self, forKey: .redirect) + self.renderingContent = try container.decodeIfPresent(SearchRenderingContent.self, forKey: .renderingContent) self.serverTimeMS = try container.decodeIfPresent(Int.self, forKey: .serverTimeMS) self.serverUsed = try container.decodeIfPresent(String.self, forKey: .serverUsed) self.userData = try container.decodeIfPresent(AnyCodable.self, forKey: .userData) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResponses.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResponses.swift index 415b61b4a6b..2434fe4258e 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResponses.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResponses.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchResponses: Codable, JSONEncodable, Hashable { public var results: [SearchResult] diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResult.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResult.swift index 1b360e6f205..39b21a892c9 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResult.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchResult.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public enum SearchResult: Codable, JSONEncodable, AbstractEncodable, Hashable { case searchForFacetValuesResponse(SearchForFacetValuesResponse) diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRulesParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRulesParams.swift index 4acf436ca3f..2736bd4a65e 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRulesParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRulesParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Rules search parameters. public struct SearchRulesParams: Codable, JSONEncodable, Hashable { @@ -23,7 +24,7 @@ public struct SearchRulesParams: Codable, JSONEncodable, Hashable { ) /// Search query for rules. public var query: String? - public var anchoring: Anchoring? + public var anchoring: SearchAnchoring? /// Only return rules that match the context (exact match). public var context: String? /// Requested page of the API response. @@ -36,7 +37,7 @@ public struct SearchRulesParams: Codable, JSONEncodable, Hashable { public init( query: String? = nil, - anchoring: Anchoring? = nil, + anchoring: SearchAnchoring? = nil, context: String? = nil, page: Int? = nil, hitsPerPage: Int? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRulesResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRulesResponse.swift index f3284bb9238..e9832ae60d5 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRulesResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchRulesResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchRulesResponse: Codable, JSONEncodable, Hashable { /// Rules that matched the search criteria. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParams.swift new file mode 100644 index 00000000000..6262c2b37fa --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParams.swift @@ -0,0 +1,48 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +public enum SearchSearchParams: Codable, JSONEncodable, AbstractEncodable, Hashable { + case searchParamsString(SearchParamsString) + case searchSearchParamsObject(SearchSearchParamsObject) + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .searchParamsString(value): + try container.encode(value) + case let .searchSearchParamsObject(value): + try container.encode(value) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(SearchParamsString.self) { + self = .searchParamsString(value) + } else if let value = try? container.decode(SearchSearchParamsObject.self) { + self = .searchSearchParamsObject(value) + } else { + throw DecodingError.typeMismatch( + Self.Type.self, + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchSearchParams" + ) + ) + } + } + + public func GetActualInstance() -> Encodable { + switch self { + case let .searchParamsString(value): + value as SearchParamsString + case let .searchSearchParamsObject(value): + value as SearchSearchParamsObject + } + } +} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParamsObject.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParamsObject.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Search/Models/SearchParamsObject.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParamsObject.swift index b3e43a537d6..824fc7bca54 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParamsObject.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParamsObject.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct SearchParamsObject: Codable, JSONEncodable, Hashable { +public struct SearchSearchParamsObject: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( minimum: 0, exclusiveMinimum: false, @@ -84,10 +85,10 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { /// array, the filter matches if it matches at least one element of the array. For more information, see /// [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). public var filters: String? - public var facetFilters: FacetFilters? - public var optionalFilters: OptionalFilters? - public var numericFilters: NumericFilters? - public var tagFilters: TagFilters? + public var facetFilters: SearchFacetFilters? + public var optionalFilters: SearchOptionalFilters? + public var numericFilters: SearchNumericFilters? + public var tagFilters: SearchTagFilters? /// Whether to sum all filter scores. If true, all filter scores are summed. Otherwise, the maximum filter score is /// kept. For more information, see [filter scores](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/in-depth/filter-scoring/#accumulating-scores-with-sumorfiltersscores). public var sumOrFiltersScores: Bool? @@ -114,8 +115,8 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { public var aroundLatLng: String? /// Whether to obtain the coordinates from the request's IP address. public var aroundLatLngViaIP: Bool? - public var aroundRadius: AroundRadius? - public var aroundPrecision: AroundPrecision? + public var aroundRadius: SearchAroundRadius? + public var aroundPrecision: SearchAroundPrecision? /// Minimum radius (in meters) for a search around a location when `aroundRadius` isn't set. public var minimumAroundRadius: Int? /// Coordinates for a rectangular area in which to search. Each bounding box is defined by the two opposite points @@ -213,7 +214,7 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { public var minWordSizefor1Typo: Int? /// Minimum number of characters a word in the search query must contain to accept matches with [two typos](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/in-depth/configuring-typo-tolerance/#configuring-word-length-for-typos). public var minWordSizefor2Typos: Int? - public var typoTolerance: TypoTolerance? + public var typoTolerance: SearchTypoTolerance? /// Whether to allow typos on numbers in the search query. Turn off this setting to reduce the number of irrelevant /// matches when searching in large sets of similar numbers. public var allowTyposOnNumericTokens: Bool? @@ -224,8 +225,8 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { /// of text, such as product descriptions. Consider alternatives such as `disableTypoToleranceOnWords` or adding /// synonyms if your attributes have intentional unusual spellings that might look like typos. public var disableTypoToleranceOnAttributes: [String]? - public var ignorePlurals: IgnorePlurals? - public var removeStopWords: RemoveStopWords? + public var ignorePlurals: SearchIgnorePlurals? + public var removeStopWords: SearchRemoveStopWords? /// Characters for which diacritics should be preserved. By default, Algolia removes diacritics from letters. For /// example, `é` becomes `e`. If this causes issues in your search, you can specify characters that should keep /// their diacritics. @@ -246,10 +247,10 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { public var enableRules: Bool? /// Whether to enable Personalization. public var enablePersonalization: Bool? - public var queryType: QueryType? - public var removeWordsIfNoResults: RemoveWordsIfNoResults? - public var mode: Mode? - public var semanticSearch: SemanticSearch? + public var queryType: SearchQueryType? + public var removeWordsIfNoResults: SearchRemoveWordsIfNoResults? + public var mode: SearchMode? + public var semanticSearch: SearchSemanticSearch? /// Whether to support phrase matching and excluding words from search queries. Use the `advancedSyntaxFeatures` /// parameter to control which feature is supported. public var advancedSyntax: Bool? @@ -271,20 +272,20 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { /// product descriptions. Turning off the Exact ranking criterion for these attributes favors exact matching on /// other attributes. This reduces the impact of individual attributes with a lot of content on ranking. public var disableExactOnAttributes: [String]? - public var exactOnSingleWordQuery: ExactOnSingleWordQuery? + public var exactOnSingleWordQuery: SearchExactOnSingleWordQuery? /// Alternatives of query words that should be considered as exact matches by the Exact ranking criterion.
///
ignorePlurals
Plurals and similar declensions added by the `ignorePlurals` setting /// are considered exact matches.
singleWordSynonym
Single-word synonyms, such as /// \"NY/NYC\" are considered exact matches.
multiWordsSynonym
Multi-word synonyms, /// such as \"NY/New York\" are considered exact matches.
. - public var alternativesAsExact: [AlternativesAsExact]? + public var alternativesAsExact: [SearchAlternativesAsExact]? /// Advanced search syntax features you want to support.
exactPhrase
Phrases in /// quotes must match exactly. For example, `sparkly blue \"iPhone case\"` only returns records with the exact /// string \"iPhone case\".
excludeWords
Query words prefixed with a `-` must not /// occur in a record. For example, `search -engine` matches records that contain \"search\" but not \"engine\". ///
This setting only has an effect if `advancedSyntax` is true. - public var advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? - public var distinct: Distinct? + public var advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? + public var distinct: SearchDistinct? /// Whether to replace a highlighted word with the matched synonym. By default, the original words are highlighted /// even if a synonym matches. For example, with `home` as a synonym for `house` and a search for `home`, records /// matching either \"home\" or \"house\" are included in the search results, and either \"home\" or \"house\" are @@ -317,20 +318,20 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { /// matching attribute is selected based on the minimum proximity of multiple matches. Otherwise, the best matching /// attribute is determined by the order in the `searchableAttributes` setting. public var attributeCriteriaComputedByMinProximity: Bool? - public var renderingContent: RenderingContent? + public var renderingContent: SearchRenderingContent? /// Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). /// This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. public var enableReRanking: Bool? - public var reRankingApplyFilter: ReRankingApplyFilter? + public var reRankingApplyFilter: SearchReRankingApplyFilter? public init( query: String? = nil, similarQuery: String? = nil, filters: String? = nil, - facetFilters: FacetFilters? = nil, - optionalFilters: OptionalFilters? = nil, - numericFilters: NumericFilters? = nil, - tagFilters: TagFilters? = nil, + facetFilters: SearchFacetFilters? = nil, + optionalFilters: SearchOptionalFilters? = nil, + numericFilters: SearchNumericFilters? = nil, + tagFilters: SearchTagFilters? = nil, sumOrFiltersScores: Bool? = nil, restrictSearchableAttributes: [String]? = nil, facets: [String]? = nil, @@ -340,8 +341,8 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { length: Int? = nil, aroundLatLng: String? = nil, aroundLatLngViaIP: Bool? = nil, - aroundRadius: AroundRadius? = nil, - aroundPrecision: AroundPrecision? = nil, + aroundRadius: SearchAroundRadius? = nil, + aroundPrecision: SearchAroundPrecision? = nil, minimumAroundRadius: Int? = nil, insideBoundingBox: [[Double]]? = nil, insidePolygon: [[Double]]? = nil, @@ -369,27 +370,27 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { hitsPerPage: Int? = nil, minWordSizefor1Typo: Int? = nil, minWordSizefor2Typos: Int? = nil, - typoTolerance: TypoTolerance? = nil, + typoTolerance: SearchTypoTolerance? = nil, allowTyposOnNumericTokens: Bool? = nil, disableTypoToleranceOnAttributes: [String]? = nil, - ignorePlurals: IgnorePlurals? = nil, - removeStopWords: RemoveStopWords? = nil, + ignorePlurals: SearchIgnorePlurals? = nil, + removeStopWords: SearchRemoveStopWords? = nil, keepDiacriticsOnCharacters: String? = nil, queryLanguages: [String]? = nil, decompoundQuery: Bool? = nil, enableRules: Bool? = nil, enablePersonalization: Bool? = nil, - queryType: QueryType? = nil, - removeWordsIfNoResults: RemoveWordsIfNoResults? = nil, - mode: Mode? = nil, - semanticSearch: SemanticSearch? = nil, + queryType: SearchQueryType? = nil, + removeWordsIfNoResults: SearchRemoveWordsIfNoResults? = nil, + mode: SearchMode? = nil, + semanticSearch: SearchSemanticSearch? = nil, advancedSyntax: Bool? = nil, optionalWords: [String]? = nil, disableExactOnAttributes: [String]? = nil, - exactOnSingleWordQuery: ExactOnSingleWordQuery? = nil, - alternativesAsExact: [AlternativesAsExact]? = nil, - advancedSyntaxFeatures: [AdvancedSyntaxFeatures]? = nil, - distinct: Distinct? = nil, + exactOnSingleWordQuery: SearchExactOnSingleWordQuery? = nil, + alternativesAsExact: [SearchAlternativesAsExact]? = nil, + advancedSyntaxFeatures: [SearchAdvancedSyntaxFeatures]? = nil, + distinct: SearchDistinct? = nil, replaceSynonymsInHighlight: Bool? = nil, minProximity: Int? = nil, responseFields: [String]? = nil, @@ -397,9 +398,9 @@ public struct SearchParamsObject: Codable, JSONEncodable, Hashable { maxValuesPerFacet: Int? = nil, sortFacetValuesBy: String? = nil, attributeCriteriaComputedByMinProximity: Bool? = nil, - renderingContent: RenderingContent? = nil, + renderingContent: SearchRenderingContent? = nil, enableReRanking: Bool? = nil, - reRankingApplyFilter: ReRankingApplyFilter? = nil + reRankingApplyFilter: SearchReRankingApplyFilter? = nil ) { self.query = query self.similarQuery = similarQuery diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParamsQuery.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParamsQuery.swift similarity index 84% rename from clients/algoliasearch-client-swift/Sources/Search/Models/SearchParamsQuery.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParamsQuery.swift index cb5d2e5641d..1237357e48f 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchParamsQuery.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSearchParamsQuery.swift @@ -1,11 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct SearchParamsQuery: Codable, JSONEncodable, Hashable { +public struct SearchSearchParamsQuery: Codable, JSONEncodable, Hashable { /// Search query. public var query: String? diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SemanticSearch.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSemanticSearch.swift similarity index 89% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/SemanticSearch.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchSemanticSearch.swift index a17535074be..0bc83a2baf1 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SemanticSearch.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSemanticSearch.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Settings for the semantic search part of NeuralSearch. Only used when `mode` is `neuralSearch`. -public struct SemanticSearch: Codable, JSONEncodable, Hashable { +public struct SearchSemanticSearch: Codable, JSONEncodable, Hashable { /// Indices from which to collect click and conversion events. If null, the current index and all its replicas are /// used. public var eventSources: [String]? diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSnippetResult.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSnippetResult.swift new file mode 100644 index 00000000000..14e541e4253 --- /dev/null +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSnippetResult.swift @@ -0,0 +1,55 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on +// https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +import Foundation +#if canImport(Core) + import Core +#endif + +public enum SearchSnippetResult: Codable, JSONEncodable, AbstractEncodable, Hashable { + case searchSnippetResultOption(SearchSnippetResultOption) + case arrayOfSearchSnippetResultOption([SearchSnippetResultOption]) + case dictionaryOfStringToSearchSnippetResultOption([String: SearchSnippetResultOption]) + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case let .searchSnippetResultOption(value): + try container.encode(value) + case let .arrayOfSearchSnippetResultOption(value): + try container.encode(value) + case let .dictionaryOfStringToSearchSnippetResultOption(value): + try container.encode(value) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(SearchSnippetResultOption.self) { + self = .searchSnippetResultOption(value) + } else if let value = try? container.decode([SearchSnippetResultOption].self) { + self = .arrayOfSearchSnippetResultOption(value) + } else if let value = try? container.decode([String: SearchSnippetResultOption].self) { + self = .dictionaryOfStringToSearchSnippetResultOption(value) + } else { + throw DecodingError.typeMismatch( + Self.Type.self, + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchSnippetResult" + ) + ) + } + } + + public func GetActualInstance() -> Encodable { + switch self { + case let .searchSnippetResultOption(value): + value as SearchSnippetResultOption + case let .arrayOfSearchSnippetResultOption(value): + value as [SearchSnippetResultOption] + case let .dictionaryOfStringToSearchSnippetResultOption(value): + value as [String: SearchSnippetResultOption] + } + } +} diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SnippetResultOption.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSnippetResultOption.swift similarity index 78% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/SnippetResultOption.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchSnippetResultOption.swift index 86d42783787..ee3f45f6112 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SnippetResultOption.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSnippetResultOption.swift @@ -1,17 +1,18 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Snippets that show the context around a matching search query. -public struct SnippetResultOption: Codable, JSONEncodable, Hashable { +public struct SearchSnippetResultOption: Codable, JSONEncodable, Hashable { /// Highlighted attribute value, including HTML tags. public var value: String - public var matchLevel: MatchLevel + public var matchLevel: SearchMatchLevel - public init(value: String, matchLevel: MatchLevel) { + public init(value: String, matchLevel: SearchMatchLevel) { self.value = value self.matchLevel = matchLevel } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SortRemainingBy.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSortRemainingBy.swift similarity index 88% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/SortRemainingBy.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchSortRemainingBy.swift index 76657f1a082..68f45239a5f 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/SortRemainingBy.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSortRemainingBy.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Order of facet values that aren't explicitly positioned with the `order` setting. <dl> /// <dt><code>count</code></dt> <dd> Order remaining facet values by decreasing count. The @@ -11,7 +12,7 @@ import Foundation /// <dt><code>alpha</code></dt> <dd>Sort facet values alphabetically.</dd> /// <dt><code>hidden</code></dt> <dd>Don't show facet values that aren't /// explicitly positioned.</dd> </dl>. -public enum SortRemainingBy: String, Codable, CaseIterable { +public enum SearchSortRemainingBy: String, Codable, CaseIterable { case count case alpha case hidden diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/Source.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSource.swift similarity index 89% rename from clients/algoliasearch-client-swift/Sources/Search/Models/Source.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchSource.swift index 20638d633db..0b1adc094ad 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/Source.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSource.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Source. -public struct Source: Codable, JSONEncodable, Hashable { +public struct SearchSource: Codable, JSONEncodable, Hashable { /// IP address range of the source. public var source: String /// Source description. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchStrategy.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchStrategy.swift index a9cd973b793..d7778f05839 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchStrategy.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchStrategy.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Strategy for multiple search queries: - `none`. Run all queries. - `stopIfEnoughMatches`. Run /// the queries one by one, stopping as soon as a query matches at least the `hitsPerPage` number of results. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSynonymsParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSynonymsParams.swift index a527fdf706a..9599b760a9b 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSynonymsParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSynonymsParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchSynonymsParams: Codable, JSONEncodable, Hashable { static let pageRule = NumericRule( diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSynonymsResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSynonymsResponse.swift index bbf3032aaac..245e684c7aa 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSynonymsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchSynonymsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SearchSynonymsResponse: Codable, JSONEncodable, Hashable { /// Matching synonyms. diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TagFilters.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTagFilters.swift similarity index 72% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/TagFilters.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchTagFilters.swift index b4a02e0732b..53933728e1d 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TagFilters.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTagFilters.swift @@ -1,24 +1,25 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Filter the search by values of the special `_tags` attribute. **Prefer using the `filters` /// parameter, which supports all filter types and combinations with boolean operators.** Different from regular /// facets, `_tags` can only be used for filtering (including or excluding records). You won't get a facet /// count. The same combination and escaping rules apply as for `facetFilters`. -public enum TagFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum SearchTagFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { case string(String) - case arrayOfMixedSearchFilters([MixedSearchFilters]) + case arrayOfSearchMixedSearchFilters([SearchMixedSearchFilters]) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .string(value): try container.encode(value) - case let .arrayOfMixedSearchFilters(value): + case let .arrayOfSearchMixedSearchFilters(value): try container.encode(value) } } @@ -27,12 +28,12 @@ public enum TagFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { let container = try decoder.singleValueContainer() if let value = try? container.decode(String.self) { self = .string(value) - } else if let value = try? container.decode([MixedSearchFilters].self) { - self = .arrayOfMixedSearchFilters(value) + } else if let value = try? container.decode([SearchMixedSearchFilters].self) { + self = .arrayOfSearchMixedSearchFilters(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of TagFilters") + .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of SearchTagFilters") ) } } @@ -41,8 +42,8 @@ public enum TagFilters: Codable, JSONEncodable, AbstractEncodable, Hashable { switch self { case let .string(value): value as String - case let .arrayOfMixedSearchFilters(value): - value as [MixedSearchFilters] + case let .arrayOfSearchMixedSearchFilters(value): + value as [SearchMixedSearchFilters] } } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TaskStatus.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTaskStatus.swift similarity index 76% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/TaskStatus.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchTaskStatus.swift index 0011cf8b587..cf7c662cbf7 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TaskStatus.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTaskStatus.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Task status, `published` if the task is completed, `notPublished` otherwise. -public enum TaskStatus: String, Codable, CaseIterable { +public enum SearchTaskStatus: String, Codable, CaseIterable { case published case notPublished } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypeDefault.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypeDefault.swift index b55773a2757..ea28fd7ac35 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypeDefault.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypeDefault.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// - `default`: perform a search query - `facet` [searches for facet /// values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypeFacet.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypeFacet.swift index 0b2ed49dc5b..cc884cc1726 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypeFacet.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypeFacet.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// - `default`: perform a search query - `facet` [searches for facet /// values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TypoTolerance.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypoTolerance.swift similarity index 68% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/TypoTolerance.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypoTolerance.swift index 12e48dc6cbf..3a249cfc680 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TypoTolerance.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypoTolerance.swift @@ -1,24 +1,25 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Whether [typo /// tolerance](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/typo-tolerance/) is enabled /// and how it is applied. If typo tolerance is true, `min`, or `strict`, [word splitting and concetenation](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/splitting-and-concatenation/) /// is also active. -public enum TypoTolerance: Codable, JSONEncodable, AbstractEncodable, Hashable { +public enum SearchTypoTolerance: Codable, JSONEncodable, AbstractEncodable, Hashable { case bool(Bool) - case typoToleranceEnum(TypoToleranceEnum) + case searchTypoToleranceEnum(SearchTypoToleranceEnum) public func encode(to encoder: Encoder) throws { var container = encoder.singleValueContainer() switch self { case let .bool(value): try container.encode(value) - case let .typoToleranceEnum(value): + case let .searchTypoToleranceEnum(value): try container.encode(value) } } @@ -27,12 +28,15 @@ public enum TypoTolerance: Codable, JSONEncodable, AbstractEncodable, Hashable { let container = try decoder.singleValueContainer() if let value = try? container.decode(Bool.self) { self = .bool(value) - } else if let value = try? container.decode(TypoToleranceEnum.self) { - self = .typoToleranceEnum(value) + } else if let value = try? container.decode(SearchTypoToleranceEnum.self) { + self = .searchTypoToleranceEnum(value) } else { throw DecodingError.typeMismatch( Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of TypoTolerance") + .init( + codingPath: decoder.codingPath, + debugDescription: "Unable to decode instance of SearchTypoTolerance" + ) ) } } @@ -41,8 +45,8 @@ public enum TypoTolerance: Codable, JSONEncodable, AbstractEncodable, Hashable { switch self { case let .bool(value): value as Bool - case let .typoToleranceEnum(value): - value as TypoToleranceEnum + case let .searchTypoToleranceEnum(value): + value as SearchTypoToleranceEnum } } } diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TypoToleranceEnum.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypoToleranceEnum.swift similarity index 85% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/TypoToleranceEnum.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypoToleranceEnum.swift index dbb88423caa..c0627ece1d3 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/TypoToleranceEnum.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchTypoToleranceEnum.swift @@ -1,15 +1,16 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// - `min`. Return matches with the lowest number of typos. For example, if you have matches without typos, /// only include those. But if there are no matches without typos (with 1 typo), include matches with 1 typo (2 /// typos). - `strict`. Return matches with the two lowest numbers of typos. With `strict`, the /// Typo ranking criterion is applied first in the `ranking` setting. -public enum TypoToleranceEnum: String, Codable, CaseIterable { +public enum SearchTypoToleranceEnum: String, Codable, CaseIterable { case min case strict } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchUserIdsParams.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchUserIdsParams.swift index eb528c982b3..edf2cda76b8 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchUserIdsParams.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchUserIdsParams.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// OK public struct SearchUserIdsParams: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchUserIdsResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchUserIdsResponse.swift index ce85b3783de..c9ffb972390 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SearchUserIdsResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchUserIdsResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// userIDs data. public struct SearchUserIdsResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Value.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchValue.swift similarity index 78% rename from clients/algoliasearch-client-swift/Sources/Recommend/Models/Value.swift rename to clients/algoliasearch-client-swift/Sources/Search/Models/SearchValue.swift index 37997a3745c..69c2f295da1 100644 --- a/clients/algoliasearch-client-swift/Sources/Recommend/Models/Value.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SearchValue.swift @@ -1,17 +1,18 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -public struct Value: Codable, JSONEncodable, Hashable { +public struct SearchValue: Codable, JSONEncodable, Hashable { /// Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at /// the top of the list. public var order: [String]? - public var sortRemainingBy: SortRemainingBy? + public var sortRemainingBy: SearchSortRemainingBy? - public init(order: [String]? = nil, sortRemainingBy: SortRemainingBy? = nil) { + public init(order: [String]? = nil, sortRemainingBy: SearchSortRemainingBy? = nil) { self.order = order self.sortRemainingBy = sortRemainingBy } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SecuredAPIKeyRestrictions.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SecuredAPIKeyRestrictions.swift index ec3f107fd71..9a524ed829c 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SecuredAPIKeyRestrictions.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SecuredAPIKeyRestrictions.swift @@ -1,12 +1,13 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct SecuredAPIKeyRestrictions: Codable, JSONEncodable, Hashable { - public var searchParams: SearchParamsObject? + public var searchParams: SearchSearchParamsObject? /// Filters that apply to every search made with the secured API key. Extra filters added at search time will be /// combined with `AND`. For example, if you set `group:admin` as fixed filter on your generated API key, and add /// `groups:visitors` to the search query, the complete set of filters will be `group:admin AND groups:visitors`. @@ -27,7 +28,7 @@ public struct SecuredAPIKeyRestrictions: Codable, JSONEncodable, Hashable { public var userToken: String? public init( - searchParams: SearchParamsObject? = nil, + searchParams: SearchSearchParamsObject? = nil, filters: String? = nil, validUntil: Int64? = nil, restrictIndices: [String]? = nil, diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SnippetResult.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SnippetResult.swift deleted file mode 100644 index 76b28935304..00000000000 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SnippetResult.swift +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on -// https://github.com/algolia/api-clients-automation. DO NOT EDIT. - -import AnyCodable -import Core -import Foundation - -public enum SnippetResult: Codable, JSONEncodable, AbstractEncodable, Hashable { - case snippetResultOption(SnippetResultOption) - case arrayOfSnippetResultOption([SnippetResultOption]) - case dictionaryOfStringToSnippetResultOption([String: SnippetResultOption]) - - public func encode(to encoder: Encoder) throws { - var container = encoder.singleValueContainer() - switch self { - case let .snippetResultOption(value): - try container.encode(value) - case let .arrayOfSnippetResultOption(value): - try container.encode(value) - case let .dictionaryOfStringToSnippetResultOption(value): - try container.encode(value) - } - } - - public init(from decoder: Decoder) throws { - let container = try decoder.singleValueContainer() - if let value = try? container.decode(SnippetResultOption.self) { - self = .snippetResultOption(value) - } else if let value = try? container.decode([SnippetResultOption].self) { - self = .arrayOfSnippetResultOption(value) - } else if let value = try? container.decode([String: SnippetResultOption].self) { - self = .dictionaryOfStringToSnippetResultOption(value) - } else { - throw DecodingError.typeMismatch( - Self.Type.self, - .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of SnippetResult") - ) - } - } - - public func GetActualInstance() -> Encodable { - switch self { - case let .snippetResultOption(value): - value as SnippetResultOption - case let .arrayOfSnippetResultOption(value): - value as [SnippetResultOption] - case let .dictionaryOfStringToSnippetResultOption(value): - value as [String: SnippetResultOption] - } - } -} diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/StandardEntries.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/StandardEntries.swift index e10da492650..50474da9cd0 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/StandardEntries.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/StandardEntries.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Key-value pairs of [supported language ISO codes](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/) /// and boolean values. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SynonymHit.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SynonymHit.swift index c63c8c5ef65..a447c07f804 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SynonymHit.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SynonymHit.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Synonym object. public struct SynonymHit: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/SynonymType.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/SynonymType.swift index b095e678b2d..782eac58434 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/SynonymType.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/SynonymType.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Synonym type. public enum SynonymType: String, Codable, CaseIterable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/TimeRange.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/TimeRange.swift index 14742edb5b2..69717682b01 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/TimeRange.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/TimeRange.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct TimeRange: Codable, JSONEncodable, Hashable { /// When the rule should start to be active, in Unix epoch time. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/UpdateApiKeyResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/UpdateApiKeyResponse.swift index 63d2a119fad..77b9055b516 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/UpdateApiKeyResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/UpdateApiKeyResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct UpdateApiKeyResponse: Codable, JSONEncodable, Hashable { /// API key. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedAtResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedAtResponse.swift index 4e1f156c20d..1fa268627ca 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedAtResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedAtResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Response, taskID, and update timestamp. public struct UpdatedAtResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedAtWithObjectIdResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedAtWithObjectIdResponse.swift index 1456d697b17..679c8a31477 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedAtWithObjectIdResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedAtWithObjectIdResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Response, taskID, unique object identifier, and an update timestamp. public struct UpdatedAtWithObjectIdResponse: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedRuleResponse.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedRuleResponse.swift index 32dfdeb5cef..064db44f45c 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedRuleResponse.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/UpdatedRuleResponse.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct UpdatedRuleResponse: Codable, JSONEncodable, Hashable { /// Unique identifier of a rule object. diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/UserHighlightResult.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/UserHighlightResult.swift index 35bb78972ed..cf1ac1d9aeb 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/UserHighlightResult.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/UserHighlightResult.swift @@ -1,15 +1,16 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct UserHighlightResult: Codable, JSONEncodable, Hashable { - public var userID: HighlightResult - public var clusterName: HighlightResult + public var userID: SearchHighlightResult + public var clusterName: SearchHighlightResult - public init(userID: HighlightResult, clusterName: HighlightResult) { + public init(userID: SearchHighlightResult, clusterName: SearchHighlightResult) { self.userID = userID self.clusterName = clusterName } diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/UserHit.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/UserHit.swift index 1bee58dd168..065f0b94f20 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/UserHit.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/UserHit.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif public struct UserHit: Codable, JSONEncodable, Hashable { static let userIDRule = StringRule(minLength: nil, maxLength: nil, pattern: "^[a-zA-Z0-9 \\-*.]+$") diff --git a/clients/algoliasearch-client-swift/Sources/Search/Models/UserId.swift b/clients/algoliasearch-client-swift/Sources/Search/Models/UserId.swift index 259f7c27e0b..6beef8ed215 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Models/UserId.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/Models/UserId.swift @@ -1,9 +1,10 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif /// Unique user ID. public struct UserId: Codable, JSONEncodable, Hashable { diff --git a/clients/algoliasearch-client-swift/Sources/Search/SearchClient.swift b/clients/algoliasearch-client-swift/Sources/Search/SearchClient.swift index 3c33d0f99a6..491198db60b 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/SearchClient.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/SearchClient.swift @@ -1,31 +1,30 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation - -typealias Client = SearchClient +#if canImport(Core) + import Core +#endif open class SearchClient { - private var configuration: Configuration + private var configuration: SearchClientConfiguration private var transporter: Transporter var appID: String { self.configuration.appID } - public init(configuration: Configuration, transporter: Transporter) { + public init(configuration: SearchClientConfiguration, transporter: Transporter) { self.configuration = configuration self.transporter = transporter } - public convenience init(configuration: Configuration) { + public convenience init(configuration: SearchClientConfiguration) { self.init(configuration: configuration, transporter: Transporter(configuration: configuration)) } public convenience init(appID: String, apiKey: String) throws { - try self.init(configuration: Configuration(appID: appID, apiKey: apiKey)) + try self.init(configuration: SearchClientConfiguration(appID: appID, apiKey: apiKey)) } /// - parameter apiKey: (body) @@ -168,7 +167,10 @@ open class SearchClient { /// - parameter source: (body) Source to add. /// - returns: CreatedAtResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open func appendSource(source: Source, requestOptions: RequestOptions? = nil) async throws -> CreatedAtResponse { + open func appendSource( + source: SearchSource, + requestOptions: RequestOptions? = nil + ) async throws -> CreatedAtResponse { let response: Response = try await appendSourceWithHTTPInfo( source: source, requestOptions: requestOptions @@ -189,7 +191,7 @@ open class SearchClient { // - returns: RequestBuilder open func appendSourceWithHTTPInfo( - source: Source, + source: SearchSource, requestOptions userRequestOptions: RequestOptions? = nil ) async throws -> Response { let resourcePath = "/1/security/sources/append" @@ -620,7 +622,7 @@ open class SearchClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "forwardToReplicas": forwardToReplicas?.encodeToJSON(), ] @@ -687,7 +689,7 @@ open class SearchClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "forwardToReplicas": forwardToReplicas?.encodeToJSON(), ] @@ -751,7 +753,7 @@ open class SearchClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -813,7 +815,7 @@ open class SearchClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -881,7 +883,7 @@ open class SearchClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -949,7 +951,7 @@ open class SearchClient { range: nil ) let body = body - let queryParameters = parameters + let queryParameters: [String: AnyCodable]? = parameters let nillableHeaders: [String: Any?]? = nil @@ -1020,14 +1022,14 @@ open class SearchClient { /// - parameter indexName: (path) Name of the index on which to perform the operation. /// - parameter deleteByParams: (body) - /// - returns: DeletedAtResponse + /// - returns: SearchDeletedAtResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func deleteBy( indexName: String, deleteByParams: DeleteByParams, requestOptions: RequestOptions? = nil - ) async throws -> DeletedAtResponse { - let response: Response = try await deleteByWithHTTPInfo( + ) async throws -> SearchDeletedAtResponse { + let response: Response = try await deleteByWithHTTPInfo( indexName: indexName, deleteByParams: deleteByParams, requestOptions: requestOptions @@ -1049,13 +1051,13 @@ open class SearchClient { // - parameter indexName: (path) Name of the index on which to perform the operation. // // - parameter deleteByParams: (body) - // - returns: RequestBuilder + // - returns: RequestBuilder open func deleteByWithHTTPInfo( indexName: String, deleteByParams: DeleteByParams, requestOptions userRequestOptions: RequestOptions? = nil - ) async throws -> Response { + ) async throws -> Response { guard !indexName.isEmpty else { throw AlgoliaError.invalidArgument("indexName", "deleteBy") } @@ -1086,10 +1088,13 @@ open class SearchClient { } /// - parameter indexName: (path) Name of the index on which to perform the operation. - /// - returns: DeletedAtResponse + /// - returns: SearchDeletedAtResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open func deleteIndex(indexName: String, requestOptions: RequestOptions? = nil) async throws -> DeletedAtResponse { - let response: Response = try await deleteIndexWithHTTPInfo( + open func deleteIndex( + indexName: String, + requestOptions: RequestOptions? = nil + ) async throws -> SearchDeletedAtResponse { + let response: Response = try await deleteIndexWithHTTPInfo( indexName: indexName, requestOptions: requestOptions ) @@ -1111,12 +1116,12 @@ open class SearchClient { // - deleteIndex // // - parameter indexName: (path) Name of the index on which to perform the operation. - // - returns: RequestBuilder + // - returns: RequestBuilder open func deleteIndexWithHTTPInfo( indexName: String, requestOptions userRequestOptions: RequestOptions? = nil - ) async throws -> Response { + ) async throws -> Response { guard !indexName.isEmpty else { throw AlgoliaError.invalidArgument("indexName", "deleteIndex") } @@ -1148,14 +1153,14 @@ open class SearchClient { /// - parameter indexName: (path) Name of the index on which to perform the operation. /// - parameter objectID: (path) Unique record identifier. - /// - returns: DeletedAtResponse + /// - returns: SearchDeletedAtResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func deleteObject( indexName: String, objectID: String, requestOptions: RequestOptions? = nil - ) async throws -> DeletedAtResponse { - let response: Response = try await deleteObjectWithHTTPInfo( + ) async throws -> SearchDeletedAtResponse { + let response: Response = try await deleteObjectWithHTTPInfo( indexName: indexName, objectID: objectID, requestOptions: requestOptions @@ -1177,13 +1182,13 @@ open class SearchClient { // - parameter indexName: (path) Name of the index on which to perform the operation. // // - parameter objectID: (path) Unique record identifier. - // - returns: RequestBuilder + // - returns: RequestBuilder open func deleteObjectWithHTTPInfo( indexName: String, objectID: String, requestOptions userRequestOptions: RequestOptions? = nil - ) async throws -> Response { + ) async throws -> Response { guard !indexName.isEmpty else { throw AlgoliaError.invalidArgument("indexName", "deleteObject") } @@ -1297,7 +1302,7 @@ open class SearchClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "forwardToReplicas": forwardToReplicas?.encodeToJSON(), ] @@ -1372,15 +1377,15 @@ open class SearchClient { /// - parameter indexName: (path) Name of the index on which to perform the operation. /// - parameter objectID: (path) Unique identifier of a synonym object. /// - parameter forwardToReplicas: (query) Whether changes are applied to replica indices. (optional) - /// - returns: DeletedAtResponse + /// - returns: SearchDeletedAtResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func deleteSynonym( indexName: String, objectID: String, forwardToReplicas: Bool? = nil, requestOptions: RequestOptions? = nil - ) async throws -> DeletedAtResponse { - let response: Response = try await deleteSynonymWithHTTPInfo( + ) async throws -> SearchDeletedAtResponse { + let response: Response = try await deleteSynonymWithHTTPInfo( indexName: indexName, objectID: objectID, forwardToReplicas: forwardToReplicas, @@ -1404,14 +1409,14 @@ open class SearchClient { // - parameter objectID: (path) Unique identifier of a synonym object. // // - parameter forwardToReplicas: (query) Whether changes are applied to replica indices. (optional) - // - returns: RequestBuilder + // - returns: RequestBuilder open func deleteSynonymWithHTTPInfo( indexName: String, objectID: String, forwardToReplicas: Bool? = nil, requestOptions userRequestOptions: RequestOptions? = nil - ) async throws -> Response { + ) async throws -> Response { guard !indexName.isEmpty else { throw AlgoliaError.invalidArgument("indexName", "deleteSynonym") } @@ -1440,7 +1445,7 @@ open class SearchClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "forwardToReplicas": forwardToReplicas?.encodeToJSON(), ] @@ -1512,10 +1517,10 @@ open class SearchClient { ) } - /// - returns: [String: Languages] + /// - returns: [String: SearchLanguages] @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open func getDictionaryLanguages(requestOptions: RequestOptions? = nil) async throws -> [String: Languages] { - let response: Response<[String: Languages]> = + open func getDictionaryLanguages(requestOptions: RequestOptions? = nil) async throws -> [String: SearchLanguages] { + let response: Response<[String: SearchLanguages]> = try await getDictionaryLanguagesWithHTTPInfo(requestOptions: requestOptions) guard let body = response.body else { @@ -1528,10 +1533,10 @@ open class SearchClient { // Lists supported languages with their supported dictionary types and number of custom entries. // Required API Key ACLs: // - settings - // - returns: RequestBuilder<[String: Languages]> + // - returns: RequestBuilder<[String: SearchLanguages]> open func getDictionaryLanguagesWithHTTPInfo(requestOptions userRequestOptions: RequestOptions? = nil) async throws - -> Response<[String: Languages]> { + -> Response<[String: SearchLanguages]> { let resourcePath = "/1/dictionaries/*/languages" let body: AnyCodable? = nil let queryParameters: [String: Any?]? = nil @@ -1645,7 +1650,7 @@ open class SearchClient { ) async throws -> Response { let resourcePath = "/1/logs" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "offset": offset?.encodeToJSON(), "length": length?.encodeToJSON(), "indexName": indexName?.encodeToJSON(), @@ -1743,7 +1748,7 @@ open class SearchClient { range: nil ) let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "attributesToRetrieve": attributesToRetrieve?.encodeToJSON(), ] @@ -1938,10 +1943,10 @@ open class SearchClient { ) } - /// - returns: [Source] + /// - returns: [SearchSource] @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) - open func getSources(requestOptions: RequestOptions? = nil) async throws -> [Source] { - let response: Response<[Source]> = try await getSourcesWithHTTPInfo(requestOptions: requestOptions) + open func getSources(requestOptions: RequestOptions? = nil) async throws -> [SearchSource] { + let response: Response<[SearchSource]> = try await getSourcesWithHTTPInfo(requestOptions: requestOptions) guard let body = response.body else { throw AlgoliaError.missingData @@ -1953,10 +1958,10 @@ open class SearchClient { // Retrieves all allowed IP addresses with access to your application. // Required API Key ACLs: // - admin - // - returns: RequestBuilder<[Source]> + // - returns: RequestBuilder<[SearchSource]> open func getSourcesWithHTTPInfo(requestOptions userRequestOptions: RequestOptions? = nil) async throws - -> Response<[Source]> { + -> Response<[SearchSource]> { let resourcePath = "/1/security/sources" let body: AnyCodable? = nil let queryParameters: [String: Any?]? = nil @@ -2254,7 +2259,7 @@ open class SearchClient { ) async throws -> Response { let resourcePath = "/1/clusters/mapping/pending" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "getClusters": getClusters?.encodeToJSON(), ] @@ -2382,7 +2387,7 @@ open class SearchClient { ) async throws -> Response { let resourcePath = "/1/indexes" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "page": page?.encodeToJSON(), "hitsPerPage": hitsPerPage?.encodeToJSON(), ] @@ -2440,7 +2445,7 @@ open class SearchClient { ) async throws -> Response { let resourcePath = "/1/clusters/mapping" let body: AnyCodable? = nil - let queryParameters = [ + let queryParameters: [String: Any?] = [ "page": page?.encodeToJSON(), "hitsPerPage": hitsPerPage?.encodeToJSON(), ] @@ -2663,7 +2668,7 @@ open class SearchClient { range: nil ) let body = attributesToUpdate - let queryParameters = [ + let queryParameters: [String: Any?] = [ "createIfNotExists": createIfNotExists?.encodeToJSON(), ] @@ -2739,7 +2744,7 @@ open class SearchClient { /// - returns: ReplaceSourceResponse @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func replaceSources( - source: [Source], + source: [SearchSource], requestOptions: RequestOptions? = nil ) async throws -> ReplaceSourceResponse { let response: Response = try await replaceSourcesWithHTTPInfo( @@ -2762,7 +2767,7 @@ open class SearchClient { // - returns: RequestBuilder open func replaceSourcesWithHTTPInfo( - source: [Source], + source: [SearchSource], requestOptions userRequestOptions: RequestOptions? = nil ) async throws -> Response { let resourcePath = "/1/security/sources" @@ -2992,7 +2997,7 @@ open class SearchClient { range: nil ) let body = rule - let queryParameters = [ + let queryParameters: [String: Any?] = [ "forwardToReplicas": forwardToReplicas?.encodeToJSON(), ] @@ -3074,7 +3079,7 @@ open class SearchClient { range: nil ) let body = rules - let queryParameters = [ + let queryParameters: [String: Any?] = [ "forwardToReplicas": forwardToReplicas?.encodeToJSON(), "clearExistingRules": clearExistingRules?.encodeToJSON(), ] @@ -3169,7 +3174,7 @@ open class SearchClient { range: nil ) let body = synonymHit - let queryParameters = [ + let queryParameters: [String: Any?] = [ "forwardToReplicas": forwardToReplicas?.encodeToJSON(), ] @@ -3251,7 +3256,7 @@ open class SearchClient { range: nil ) let body = synonymHit - let queryParameters = [ + let queryParameters: [String: Any?] = [ "forwardToReplicas": forwardToReplicas?.encodeToJSON(), "replaceExistingSynonyms": replaceExistingSynonyms?.encodeToJSON(), ] @@ -3543,7 +3548,7 @@ open class SearchClient { @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open func searchSingleIndex( indexName: String, - searchParams: SearchParams? = nil, + searchParams: SearchSearchParams? = nil, requestOptions: RequestOptions? = nil ) async throws -> SearchResponse { let response: Response = try await searchSingleIndexWithHTTPInfo( @@ -3572,7 +3577,7 @@ open class SearchClient { open func searchSingleIndexWithHTTPInfo( indexName: String, - searchParams: SearchParams? = nil, + searchParams: SearchSearchParams? = nil, requestOptions userRequestOptions: RequestOptions? = nil ) async throws -> Response { guard !indexName.isEmpty else { @@ -3828,7 +3833,7 @@ open class SearchClient { range: nil ) let body = indexSettings - let queryParameters = [ + let queryParameters: [String: Any?] = [ "forwardToReplicas": forwardToReplicas?.encodeToJSON(), ] diff --git a/clients/algoliasearch-client-swift/Sources/Search/Configuration.swift b/clients/algoliasearch-client-swift/Sources/Search/SearchClientConfiguration.swift similarity index 94% rename from clients/algoliasearch-client-swift/Sources/Search/Configuration.swift rename to clients/algoliasearch-client-swift/Sources/Search/SearchClientConfiguration.swift index e477be27079..670aa77211c 100644 --- a/clients/algoliasearch-client-swift/Sources/Search/Configuration.swift +++ b/clients/algoliasearch-client-swift/Sources/Search/SearchClientConfiguration.swift @@ -1,13 +1,12 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on // https://github.com/algolia/api-clients-automation. DO NOT EDIT. -import AnyCodable -import Core import Foundation +#if canImport(Core) + import Core +#endif -typealias SearchClientConfiguration = Configuration - -public struct Configuration: Core.Configuration, Credentials { +public struct SearchClientConfiguration: BaseConfiguration, Credentials { public let appID: String public let apiKey: String public var writeTimeout: TimeInterval diff --git a/snippets/swift/Package.swift b/snippets/swift/Package.swift index c3fcfe95d23..4660b356728 100644 --- a/snippets/swift/Package.swift +++ b/snippets/swift/Package.swift @@ -6,7 +6,7 @@ let package = Package( name: "AlgoliaSearchClientSnippets", platforms: [ .iOS(.v13), - .macOS(.v10_15), + .macOS(.v11), .tvOS(.v13), .watchOS(.v6), ], @@ -18,13 +18,11 @@ let package = Package( ], dependencies: [ .package(path: "../../clients/algoliasearch-client-swift"), - .package(url: "https://github.com/Flight-School/AnyCodable", from: "0.6.7"), ], targets: [ .target( name: "AlgoliaSearchClientSnippets", dependencies: [ - .product(name: "AnyCodable", package: "AnyCodable"), .product( name: "Abtesting", package: "algoliasearch-client-swift" diff --git a/snippets/swift/Sources/Abtesting.swift b/snippets/swift/Sources/Abtesting.swift index d8d83f403fd..ac30a42d7a1 100644 --- a/snippets/swift/Sources/Abtesting.swift +++ b/snippets/swift/Sources/Abtesting.swift @@ -1,7 +1,7 @@ -import AnyCodable - +#if canImport(Core) + import Core +#endif import Abtesting -import Core final class AbtestingClientSnippet { /// Snippet for the addABTests method. @@ -10,7 +10,7 @@ final class AbtestingClientSnippet { func snippetForAddABTests() async throws { // >SEPARATOR addABTests // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.addABTests( @@ -39,7 +39,7 @@ final class AbtestingClientSnippet { func snippetForCustomDelete() async throws { // >SEPARATOR customDelete // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customDelete( @@ -54,7 +54,7 @@ final class AbtestingClientSnippet { func snippetForCustomGet() async throws { // >SEPARATOR customGet // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customGet( @@ -69,7 +69,7 @@ final class AbtestingClientSnippet { func snippetForCustomPost() async throws { // >SEPARATOR customPost // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPost( @@ -84,7 +84,7 @@ final class AbtestingClientSnippet { func snippetForCustomPut() async throws { // >SEPARATOR customPut // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPut( @@ -99,7 +99,7 @@ final class AbtestingClientSnippet { func snippetForDeleteABTest() async throws { // >SEPARATOR deleteABTest // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.deleteABTest( @@ -114,7 +114,7 @@ final class AbtestingClientSnippet { func snippetForGetABTest() async throws { // >SEPARATOR getABTest // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getABTest( @@ -129,7 +129,7 @@ final class AbtestingClientSnippet { func snippetForListABTests() async throws { // >SEPARATOR listABTests // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.listABTests() @@ -142,7 +142,7 @@ final class AbtestingClientSnippet { func snippetForStopABTest() async throws { // >SEPARATOR stopABTest // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.stopABTest( diff --git a/snippets/swift/Sources/Analytics.swift b/snippets/swift/Sources/Analytics.swift index e2bd4867c0b..7a510a80b38 100644 --- a/snippets/swift/Sources/Analytics.swift +++ b/snippets/swift/Sources/Analytics.swift @@ -1,7 +1,7 @@ -import AnyCodable - +#if canImport(Core) + import Core +#endif import Analytics -import Core final class AnalyticsClientSnippet { /// Snippet for the customDelete method. @@ -10,7 +10,7 @@ final class AnalyticsClientSnippet { func snippetForCustomDelete() async throws { // >SEPARATOR customDelete // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customDelete( @@ -25,7 +25,7 @@ final class AnalyticsClientSnippet { func snippetForCustomGet() async throws { // >SEPARATOR customGet // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customGet( @@ -40,7 +40,7 @@ final class AnalyticsClientSnippet { func snippetForCustomPost() async throws { // >SEPARATOR customPost // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPost( @@ -55,7 +55,7 @@ final class AnalyticsClientSnippet { func snippetForCustomPut() async throws { // >SEPARATOR customPut // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPut( @@ -70,7 +70,7 @@ final class AnalyticsClientSnippet { func snippetForGetAverageClickPosition() async throws { // >SEPARATOR getAverageClickPosition // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getAverageClickPosition( @@ -85,7 +85,7 @@ final class AnalyticsClientSnippet { func snippetForGetClickPositions() async throws { // >SEPARATOR getClickPositions // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getClickPositions( @@ -100,7 +100,7 @@ final class AnalyticsClientSnippet { func snippetForGetClickThroughRate() async throws { // >SEPARATOR getClickThroughRate // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getClickThroughRate( @@ -115,7 +115,7 @@ final class AnalyticsClientSnippet { func snippetForGetConversationRate() async throws { // >SEPARATOR getConversationRate // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getConversationRate( @@ -130,7 +130,7 @@ final class AnalyticsClientSnippet { func snippetForGetNoClickRate() async throws { // >SEPARATOR getNoClickRate // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getNoClickRate( @@ -145,7 +145,7 @@ final class AnalyticsClientSnippet { func snippetForGetNoResultsRate() async throws { // >SEPARATOR getNoResultsRate // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getNoResultsRate( @@ -160,7 +160,7 @@ final class AnalyticsClientSnippet { func snippetForGetSearchesCount() async throws { // >SEPARATOR getSearchesCount // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getSearchesCount( @@ -175,7 +175,7 @@ final class AnalyticsClientSnippet { func snippetForGetSearchesNoClicks() async throws { // >SEPARATOR getSearchesNoClicks // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getSearchesNoClicks( @@ -190,7 +190,7 @@ final class AnalyticsClientSnippet { func snippetForGetSearchesNoResults() async throws { // >SEPARATOR getSearchesNoResults // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getSearchesNoResults( @@ -205,7 +205,7 @@ final class AnalyticsClientSnippet { func snippetForGetStatus() async throws { // >SEPARATOR getStatus // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getStatus( @@ -220,7 +220,7 @@ final class AnalyticsClientSnippet { func snippetForGetTopCountries() async throws { // >SEPARATOR getTopCountries // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getTopCountries( @@ -235,7 +235,7 @@ final class AnalyticsClientSnippet { func snippetForGetTopFilterAttributes() async throws { // >SEPARATOR getTopFilterAttributes // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getTopFilterAttributes( @@ -250,7 +250,7 @@ final class AnalyticsClientSnippet { func snippetForGetTopFilterForAttribute() async throws { // >SEPARATOR getTopFilterForAttribute // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getTopFilterForAttribute( @@ -266,7 +266,7 @@ final class AnalyticsClientSnippet { func snippetForGetTopFiltersNoResults() async throws { // >SEPARATOR getTopFiltersNoResults // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getTopFiltersNoResults( @@ -281,7 +281,7 @@ final class AnalyticsClientSnippet { func snippetForGetTopHits() async throws { // >SEPARATOR getTopHits // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getTopHits( @@ -296,7 +296,7 @@ final class AnalyticsClientSnippet { func snippetForGetTopSearches() async throws { // >SEPARATOR getTopSearches // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getTopSearches( @@ -311,7 +311,7 @@ final class AnalyticsClientSnippet { func snippetForGetUsersCount() async throws { // >SEPARATOR getUsersCount // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getUsersCount( diff --git a/snippets/swift/Sources/Ingestion.swift b/snippets/swift/Sources/Ingestion.swift index 5b9be41e899..77d48bcca2e 100644 --- a/snippets/swift/Sources/Ingestion.swift +++ b/snippets/swift/Sources/Ingestion.swift @@ -1,6 +1,6 @@ -import AnyCodable - -import Core +#if canImport(Core) + import Core +#endif import Ingestion final class IngestionClientSnippet { @@ -10,7 +10,7 @@ final class IngestionClientSnippet { func snippetForCreateAuthentication() async throws { // >SEPARATOR createAuthentication // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.createAuthentication( @@ -35,7 +35,7 @@ final class IngestionClientSnippet { func snippetForCreateDestination() async throws { // >SEPARATOR createDestination // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.createDestination( @@ -59,7 +59,7 @@ final class IngestionClientSnippet { func snippetForCreateSource() async throws { // >SEPARATOR createSource // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.createSource( @@ -90,7 +90,7 @@ final class IngestionClientSnippet { func snippetForCreateTask() async throws { // >SEPARATOR createTask // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.createTask( @@ -114,7 +114,7 @@ final class IngestionClientSnippet { func snippetForCustomDelete() async throws { // >SEPARATOR customDelete // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customDelete( @@ -129,7 +129,7 @@ final class IngestionClientSnippet { func snippetForCustomGet() async throws { // >SEPARATOR customGet // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customGet( @@ -144,7 +144,7 @@ final class IngestionClientSnippet { func snippetForCustomPost() async throws { // >SEPARATOR customPost // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPost( @@ -159,7 +159,7 @@ final class IngestionClientSnippet { func snippetForCustomPut() async throws { // >SEPARATOR customPut // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPut( @@ -174,7 +174,7 @@ final class IngestionClientSnippet { func snippetForDeleteAuthentication() async throws { // >SEPARATOR deleteAuthentication // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.deleteAuthentication( @@ -189,7 +189,7 @@ final class IngestionClientSnippet { func snippetForDeleteDestination() async throws { // >SEPARATOR deleteDestination // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.deleteDestination( @@ -204,7 +204,7 @@ final class IngestionClientSnippet { func snippetForDeleteSource() async throws { // >SEPARATOR deleteSource // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.deleteSource( @@ -219,7 +219,7 @@ final class IngestionClientSnippet { func snippetForDeleteTask() async throws { // >SEPARATOR deleteTask // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.deleteTask( @@ -234,7 +234,7 @@ final class IngestionClientSnippet { func snippetForDisableTask() async throws { // >SEPARATOR disableTask // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.disableTask( @@ -249,7 +249,7 @@ final class IngestionClientSnippet { func snippetForEnableTask() async throws { // >SEPARATOR enableTask // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.enableTask( @@ -264,7 +264,7 @@ final class IngestionClientSnippet { func snippetForGetAuthentication() async throws { // >SEPARATOR getAuthentication // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getAuthentication( @@ -279,7 +279,7 @@ final class IngestionClientSnippet { func snippetForGetAuthentications() async throws { // >SEPARATOR getAuthentications // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getAuthentications() @@ -292,7 +292,7 @@ final class IngestionClientSnippet { func snippetForGetDestination() async throws { // >SEPARATOR getDestination // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getDestination( @@ -307,7 +307,7 @@ final class IngestionClientSnippet { func snippetForGetDestinations() async throws { // >SEPARATOR getDestinations // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getDestinations() @@ -320,7 +320,7 @@ final class IngestionClientSnippet { func snippetForGetDockerSourceStreams() async throws { // >SEPARATOR getDockerSourceStreams // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getDockerSourceStreams( @@ -335,7 +335,7 @@ final class IngestionClientSnippet { func snippetForGetEvent() async throws { // >SEPARATOR getEvent // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getEvent( @@ -351,7 +351,7 @@ final class IngestionClientSnippet { func snippetForGetEvents() async throws { // >SEPARATOR getEvents // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getEvents( @@ -366,7 +366,7 @@ final class IngestionClientSnippet { func snippetForGetRun() async throws { // >SEPARATOR getRun // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getRun( @@ -381,7 +381,7 @@ final class IngestionClientSnippet { func snippetForGetRuns() async throws { // >SEPARATOR getRuns // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getRuns() @@ -394,7 +394,7 @@ final class IngestionClientSnippet { func snippetForGetSource() async throws { // >SEPARATOR getSource // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getSource( @@ -409,7 +409,7 @@ final class IngestionClientSnippet { func snippetForGetSources() async throws { // >SEPARATOR getSources // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getSources() @@ -422,7 +422,7 @@ final class IngestionClientSnippet { func snippetForGetTask() async throws { // >SEPARATOR getTask // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getTask( @@ -437,7 +437,7 @@ final class IngestionClientSnippet { func snippetForGetTasks() async throws { // >SEPARATOR getTasks // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getTasks() @@ -450,7 +450,7 @@ final class IngestionClientSnippet { func snippetForRunTask() async throws { // >SEPARATOR runTask // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.runTask( @@ -465,7 +465,7 @@ final class IngestionClientSnippet { func snippetForSearchAuthentications() async throws { // >SEPARATOR searchAuthentications // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.searchAuthentications( @@ -485,7 +485,7 @@ final class IngestionClientSnippet { func snippetForSearchDestinations() async throws { // >SEPARATOR searchDestinations // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.searchDestinations( @@ -505,7 +505,7 @@ final class IngestionClientSnippet { func snippetForSearchSources() async throws { // >SEPARATOR searchSources // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.searchSources( @@ -525,7 +525,7 @@ final class IngestionClientSnippet { func snippetForSearchTasks() async throws { // >SEPARATOR searchTasks // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.searchTasks( @@ -546,7 +546,7 @@ final class IngestionClientSnippet { func snippetForTriggerDockerSourceDiscover() async throws { // >SEPARATOR triggerDockerSourceDiscover // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.triggerDockerSourceDiscover( @@ -561,7 +561,7 @@ final class IngestionClientSnippet { func snippetForUpdateAuthentication() async throws { // >SEPARATOR updateAuthentication // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.updateAuthentication( @@ -579,7 +579,7 @@ final class IngestionClientSnippet { func snippetForUpdateDestination() async throws { // >SEPARATOR updateDestination // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.updateDestination( @@ -597,7 +597,7 @@ final class IngestionClientSnippet { func snippetForUpdateSource() async throws { // >SEPARATOR updateSource // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.updateSource( @@ -615,7 +615,7 @@ final class IngestionClientSnippet { func snippetForUpdateTask() async throws { // >SEPARATOR updateTask // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.updateTask( diff --git a/snippets/swift/Sources/Insights.swift b/snippets/swift/Sources/Insights.swift index 896bc4e7309..28fbcac4708 100644 --- a/snippets/swift/Sources/Insights.swift +++ b/snippets/swift/Sources/Insights.swift @@ -1,6 +1,6 @@ -import AnyCodable - -import Core +#if canImport(Core) + import Core +#endif import Insights final class InsightsClientSnippet { @@ -10,7 +10,7 @@ final class InsightsClientSnippet { func snippetForCustomDelete() async throws { // >SEPARATOR customDelete // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customDelete( @@ -25,7 +25,7 @@ final class InsightsClientSnippet { func snippetForCustomGet() async throws { // >SEPARATOR customGet // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customGet( @@ -40,7 +40,7 @@ final class InsightsClientSnippet { func snippetForCustomPost() async throws { // >SEPARATOR customPost // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPost( @@ -55,7 +55,7 @@ final class InsightsClientSnippet { func snippetForCustomPut() async throws { // >SEPARATOR customPut // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPut( @@ -70,7 +70,7 @@ final class InsightsClientSnippet { func snippetForDeleteUserToken() async throws { // >SEPARATOR deleteUserToken // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.deleteUserToken( @@ -85,7 +85,7 @@ final class InsightsClientSnippet { func snippetForPushEvents() async throws { // >SEPARATOR pushEvents // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client diff --git a/snippets/swift/Sources/Monitoring.swift b/snippets/swift/Sources/Monitoring.swift index e2e8ac4e7aa..98499f26070 100644 --- a/snippets/swift/Sources/Monitoring.swift +++ b/snippets/swift/Sources/Monitoring.swift @@ -1,6 +1,6 @@ -import AnyCodable - -import Core +#if canImport(Core) + import Core +#endif import Monitoring final class MonitoringClientSnippet { @@ -10,7 +10,7 @@ final class MonitoringClientSnippet { func snippetForCustomDelete() async throws { // >SEPARATOR customDelete // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customDelete( @@ -25,7 +25,7 @@ final class MonitoringClientSnippet { func snippetForCustomGet() async throws { // >SEPARATOR customGet // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customGet( @@ -40,7 +40,7 @@ final class MonitoringClientSnippet { func snippetForCustomPost() async throws { // >SEPARATOR customPost // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customPost( @@ -55,7 +55,7 @@ final class MonitoringClientSnippet { func snippetForCustomPut() async throws { // >SEPARATOR customPut // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customPut( @@ -70,7 +70,7 @@ final class MonitoringClientSnippet { func snippetForGetClusterIncidents() async throws { // >SEPARATOR getClusterIncidents // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getClusterIncidents( @@ -85,7 +85,7 @@ final class MonitoringClientSnippet { func snippetForGetClusterStatus() async throws { // >SEPARATOR getClusterStatus // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getClusterStatus( @@ -100,7 +100,7 @@ final class MonitoringClientSnippet { func snippetForGetIncidents() async throws { // >SEPARATOR getIncidents // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getIncidents() @@ -113,7 +113,7 @@ final class MonitoringClientSnippet { func snippetForGetIndexingTime() async throws { // >SEPARATOR getIndexingTime // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getIndexingTime( @@ -128,7 +128,7 @@ final class MonitoringClientSnippet { func snippetForGetInventory() async throws { // >SEPARATOR getInventory // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getInventory() @@ -141,7 +141,7 @@ final class MonitoringClientSnippet { func snippetForGetLatency() async throws { // >SEPARATOR getLatency // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getLatency( @@ -156,7 +156,7 @@ final class MonitoringClientSnippet { func snippetForGetMetrics() async throws { // >SEPARATOR getMetrics // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getMetrics( @@ -172,7 +172,7 @@ final class MonitoringClientSnippet { func snippetForGetReachability() async throws { // >SEPARATOR getReachability // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getReachability( @@ -187,7 +187,7 @@ final class MonitoringClientSnippet { func snippetForGetStatus() async throws { // >SEPARATOR getStatus // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getStatus() diff --git a/snippets/swift/Sources/Personalization.swift b/snippets/swift/Sources/Personalization.swift index 70740d430d5..2ebd41f7955 100644 --- a/snippets/swift/Sources/Personalization.swift +++ b/snippets/swift/Sources/Personalization.swift @@ -1,6 +1,6 @@ -import AnyCodable - -import Core +#if canImport(Core) + import Core +#endif import Personalization final class PersonalizationClientSnippet { @@ -10,7 +10,7 @@ final class PersonalizationClientSnippet { func snippetForCustomDelete() async throws { // >SEPARATOR customDelete // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customDelete( @@ -25,7 +25,7 @@ final class PersonalizationClientSnippet { func snippetForCustomGet() async throws { // >SEPARATOR customGet // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customGet( @@ -40,7 +40,7 @@ final class PersonalizationClientSnippet { func snippetForCustomPost() async throws { // >SEPARATOR customPost // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPost( @@ -55,7 +55,7 @@ final class PersonalizationClientSnippet { func snippetForCustomPut() async throws { // >SEPARATOR customPut // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPut( @@ -70,7 +70,7 @@ final class PersonalizationClientSnippet { func snippetForDeleteUserProfile() async throws { // >SEPARATOR deleteUserProfile // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.deleteUserProfile( @@ -85,7 +85,7 @@ final class PersonalizationClientSnippet { func snippetForGetPersonalizationStrategy() async throws { // >SEPARATOR getPersonalizationStrategy // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getPersonalizationStrategy() @@ -98,7 +98,7 @@ final class PersonalizationClientSnippet { func snippetForGetUserTokenProfile() async throws { // >SEPARATOR getUserTokenProfile // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getUserTokenProfile( @@ -113,7 +113,7 @@ final class PersonalizationClientSnippet { func snippetForSetPersonalizationStrategy() async throws { // >SEPARATOR setPersonalizationStrategy // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.setPersonalizationStrategy( diff --git a/snippets/swift/Sources/QuerySuggestions.swift b/snippets/swift/Sources/QuerySuggestions.swift index bbe6723e860..cabc728feb7 100644 --- a/snippets/swift/Sources/QuerySuggestions.swift +++ b/snippets/swift/Sources/QuerySuggestions.swift @@ -1,6 +1,6 @@ -import AnyCodable - -import Core +#if canImport(Core) + import Core +#endif import QuerySuggestions final class QuerySuggestionsClientSnippet { @@ -10,7 +10,7 @@ final class QuerySuggestionsClientSnippet { func snippetForCreateConfig() async throws { // >SEPARATOR createConfig // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.createConfig( @@ -35,7 +35,7 @@ final class QuerySuggestionsClientSnippet { ] ), ], - languages: Languages.arrayOfString( + languages: QuerySuggestionsLanguages.arrayOfString( [ "french", ] @@ -54,7 +54,7 @@ final class QuerySuggestionsClientSnippet { func snippetForCustomDelete() async throws { // >SEPARATOR customDelete // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customDelete( @@ -69,7 +69,7 @@ final class QuerySuggestionsClientSnippet { func snippetForCustomGet() async throws { // >SEPARATOR customGet // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customGet( @@ -84,7 +84,7 @@ final class QuerySuggestionsClientSnippet { func snippetForCustomPost() async throws { // >SEPARATOR customPost // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPost( @@ -99,7 +99,7 @@ final class QuerySuggestionsClientSnippet { func snippetForCustomPut() async throws { // >SEPARATOR customPut // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.customPut( @@ -114,7 +114,7 @@ final class QuerySuggestionsClientSnippet { func snippetForDeleteConfig() async throws { // >SEPARATOR deleteConfig // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.deleteConfig( @@ -129,7 +129,7 @@ final class QuerySuggestionsClientSnippet { func snippetForGetAllConfigs() async throws { // >SEPARATOR getAllConfigs // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getAllConfigs() @@ -142,7 +142,7 @@ final class QuerySuggestionsClientSnippet { func snippetForGetConfig() async throws { // >SEPARATOR getConfig // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getConfig( @@ -157,7 +157,7 @@ final class QuerySuggestionsClientSnippet { func snippetForGetConfigStatus() async throws { // >SEPARATOR getConfigStatus // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getConfigStatus( @@ -172,7 +172,7 @@ final class QuerySuggestionsClientSnippet { func snippetForGetLogFile() async throws { // >SEPARATOR getLogFile // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.getLogFile( @@ -187,12 +187,12 @@ final class QuerySuggestionsClientSnippet { func snippetForUpdateConfig() async throws { // >SEPARATOR updateConfig // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) // Call the API _ = try await client.updateConfig( indexName: "theIndexName", - querySuggestionsConfiguration: QuerySuggestionsConfiguration( + configuration: QuerySuggestionsConfiguration( sourceIndices: [ SourceIndex( indexName: "testIndex", @@ -212,7 +212,7 @@ final class QuerySuggestionsClientSnippet { ] ), ], - languages: Languages.arrayOfString( + languages: QuerySuggestionsLanguages.arrayOfString( [ "french", ] diff --git a/snippets/swift/Sources/Recommend.swift b/snippets/swift/Sources/Recommend.swift index af88ef1dfb2..53a658b8fd2 100644 --- a/snippets/swift/Sources/Recommend.swift +++ b/snippets/swift/Sources/Recommend.swift @@ -1,6 +1,6 @@ -import AnyCodable - -import Core +#if canImport(Core) + import Core +#endif import Recommend final class RecommendClientSnippet { @@ -10,7 +10,7 @@ final class RecommendClientSnippet { func snippetForCustomDelete() async throws { // >SEPARATOR customDelete // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customDelete( @@ -25,7 +25,7 @@ final class RecommendClientSnippet { func snippetForCustomGet() async throws { // >SEPARATOR customGet // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customGet( @@ -40,7 +40,7 @@ final class RecommendClientSnippet { func snippetForCustomPost() async throws { // >SEPARATOR customPost // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customPost( @@ -55,7 +55,7 @@ final class RecommendClientSnippet { func snippetForCustomPut() async throws { // >SEPARATOR customPut // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customPut( @@ -70,7 +70,7 @@ final class RecommendClientSnippet { func snippetForDeleteRecommendRule() async throws { // >SEPARATOR deleteRecommendRule // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.deleteRecommendRule( @@ -87,7 +87,7 @@ final class RecommendClientSnippet { func snippetForGetRecommendRule() async throws { // >SEPARATOR getRecommendRule // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getRecommendRule( @@ -104,7 +104,7 @@ final class RecommendClientSnippet { func snippetForGetRecommendStatus() async throws { // >SEPARATOR getRecommendStatus // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getRecommendStatus( @@ -121,7 +121,7 @@ final class RecommendClientSnippet { func snippetForGetRecommendations() async throws { // >SEPARATOR getRecommendations // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client @@ -149,7 +149,7 @@ final class RecommendClientSnippet { func snippetForSearchRecommendRules() async throws { // >SEPARATOR searchRecommendRules // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.searchRecommendRules( diff --git a/snippets/swift/Sources/Search.swift b/snippets/swift/Sources/Search.swift index 34f048afb99..05d1dafc5a3 100644 --- a/snippets/swift/Sources/Search.swift +++ b/snippets/swift/Sources/Search.swift @@ -1,6 +1,6 @@ -import AnyCodable - -import Core +#if canImport(Core) + import Core +#endif import Search final class SearchClientSnippet { @@ -10,7 +10,7 @@ final class SearchClientSnippet { func snippetForAddApiKey() async throws { // >SEPARATOR addApiKey // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.addApiKey( @@ -34,7 +34,7 @@ final class SearchClientSnippet { func snippetForAddOrUpdateObject() async throws { // >SEPARATOR addOrUpdateObject // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.addOrUpdateObject( @@ -53,11 +53,11 @@ final class SearchClientSnippet { func snippetForAppendSource() async throws { // >SEPARATOR appendSource // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.appendSource( - source: Source( + source: SearchSource( source: "theSource", description: "theDescription" ) @@ -71,7 +71,7 @@ final class SearchClientSnippet { func snippetForAssignUserId() async throws { // >SEPARATOR assignUserId // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.assignUserId( @@ -89,7 +89,7 @@ final class SearchClientSnippet { func snippetForBatch() async throws { // >SEPARATOR batch // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.batch( @@ -114,7 +114,7 @@ final class SearchClientSnippet { func snippetForBatchAssignUserIds() async throws { // >SEPARATOR batchAssignUserIds // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.batchAssignUserIds( @@ -136,7 +136,7 @@ final class SearchClientSnippet { func snippetForBatchDictionaryEntries() async throws { // >SEPARATOR batchDictionaryEntries // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.batchDictionaryEntries( @@ -169,7 +169,7 @@ final class SearchClientSnippet { func snippetForBrowse() async throws { // >SEPARATOR browse // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.browse( @@ -184,7 +184,7 @@ final class SearchClientSnippet { func snippetForClearObjects() async throws { // >SEPARATOR clearObjects // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.clearObjects( @@ -199,7 +199,7 @@ final class SearchClientSnippet { func snippetForClearRules() async throws { // >SEPARATOR clearRules // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.clearRules( @@ -214,7 +214,7 @@ final class SearchClientSnippet { func snippetForClearSynonyms() async throws { // >SEPARATOR clearSynonyms // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.clearSynonyms( @@ -229,7 +229,7 @@ final class SearchClientSnippet { func snippetForCustomDelete() async throws { // >SEPARATOR customDelete // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customDelete( @@ -244,7 +244,7 @@ final class SearchClientSnippet { func snippetForCustomGet() async throws { // >SEPARATOR customGet // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customGet( @@ -259,7 +259,7 @@ final class SearchClientSnippet { func snippetForCustomPost() async throws { // >SEPARATOR customPost // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customPost( @@ -274,7 +274,7 @@ final class SearchClientSnippet { func snippetForCustomPut() async throws { // >SEPARATOR customPut // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.customPut( @@ -289,7 +289,7 @@ final class SearchClientSnippet { func snippetForDeleteApiKey() async throws { // >SEPARATOR deleteApiKey // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.deleteApiKey( @@ -304,7 +304,7 @@ final class SearchClientSnippet { func snippetForDeleteBy() async throws { // >SEPARATOR deleteBy // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.deleteBy( @@ -322,7 +322,7 @@ final class SearchClientSnippet { func snippetForDeleteIndex() async throws { // >SEPARATOR deleteIndex // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.deleteIndex( @@ -337,7 +337,7 @@ final class SearchClientSnippet { func snippetForDeleteObject() async throws { // >SEPARATOR deleteObject // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.deleteObject( @@ -353,7 +353,7 @@ final class SearchClientSnippet { func snippetForDeleteRule() async throws { // >SEPARATOR deleteRule // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.deleteRule( @@ -369,7 +369,7 @@ final class SearchClientSnippet { func snippetForDeleteSource() async throws { // >SEPARATOR deleteSource // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.deleteSource( @@ -384,7 +384,7 @@ final class SearchClientSnippet { func snippetForDeleteSynonym() async throws { // >SEPARATOR deleteSynonym // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.deleteSynonym( @@ -400,7 +400,7 @@ final class SearchClientSnippet { func snippetForGetApiKey() async throws { // >SEPARATOR getApiKey // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getApiKey( @@ -415,7 +415,7 @@ final class SearchClientSnippet { func snippetForGetDictionaryLanguages() async throws { // >SEPARATOR getDictionaryLanguages // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getDictionaryLanguages() @@ -428,7 +428,7 @@ final class SearchClientSnippet { func snippetForGetDictionarySettings() async throws { // >SEPARATOR getDictionarySettings // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getDictionarySettings() @@ -441,7 +441,7 @@ final class SearchClientSnippet { func snippetForGetLogs() async throws { // >SEPARATOR getLogs // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getLogs() @@ -454,7 +454,7 @@ final class SearchClientSnippet { func snippetForGetObject() async throws { // >SEPARATOR getObject // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getObject( @@ -474,7 +474,7 @@ final class SearchClientSnippet { func snippetForGetObjects() async throws { // >SEPARATOR getObjects // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getObjects( @@ -500,7 +500,7 @@ final class SearchClientSnippet { func snippetForGetRule() async throws { // >SEPARATOR getRule // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getRule( @@ -516,7 +516,7 @@ final class SearchClientSnippet { func snippetForGetSettings() async throws { // >SEPARATOR getSettings // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getSettings( @@ -531,7 +531,7 @@ final class SearchClientSnippet { func snippetForGetSources() async throws { // >SEPARATOR getSources // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getSources() @@ -544,7 +544,7 @@ final class SearchClientSnippet { func snippetForGetSynonym() async throws { // >SEPARATOR getSynonym // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getSynonym( @@ -560,7 +560,7 @@ final class SearchClientSnippet { func snippetForGetTask() async throws { // >SEPARATOR getTask // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getTask( @@ -576,7 +576,7 @@ final class SearchClientSnippet { func snippetForGetTopUserIds() async throws { // >SEPARATOR getTopUserIds // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getTopUserIds() @@ -589,7 +589,7 @@ final class SearchClientSnippet { func snippetForGetUserId() async throws { // >SEPARATOR getUserId // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.getUserId( @@ -604,7 +604,7 @@ final class SearchClientSnippet { func snippetForHasPendingMappings() async throws { // >SEPARATOR hasPendingMappings // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.hasPendingMappings() @@ -617,7 +617,7 @@ final class SearchClientSnippet { func snippetForListApiKeys() async throws { // >SEPARATOR listApiKeys // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.listApiKeys() @@ -630,7 +630,7 @@ final class SearchClientSnippet { func snippetForListClusters() async throws { // >SEPARATOR listClusters // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.listClusters() @@ -643,7 +643,7 @@ final class SearchClientSnippet { func snippetForListIndices() async throws { // >SEPARATOR listIndices // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.listIndices() @@ -656,7 +656,7 @@ final class SearchClientSnippet { func snippetForListUserIds() async throws { // >SEPARATOR listUserIds // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.listUserIds() @@ -669,7 +669,7 @@ final class SearchClientSnippet { func snippetForMultipleBatch() async throws { // >SEPARATOR multipleBatch // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.multipleBatch( @@ -694,7 +694,7 @@ final class SearchClientSnippet { func snippetForOperationIndex() async throws { // >SEPARATOR operationIndex // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.operationIndex( @@ -717,7 +717,7 @@ final class SearchClientSnippet { func snippetForPartialUpdateObject() async throws { // >SEPARATOR partialUpdateObject // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.partialUpdateObject( @@ -739,7 +739,7 @@ final class SearchClientSnippet { func snippetForRemoveUserId() async throws { // >SEPARATOR removeUserId // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.removeUserId( @@ -754,12 +754,12 @@ final class SearchClientSnippet { func snippetForReplaceSources() async throws { // >SEPARATOR replaceSources // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.replaceSources( source: [ - Source( + SearchSource( source: "theSource", description: "theDescription" ), @@ -774,7 +774,7 @@ final class SearchClientSnippet { func snippetForRestoreApiKey() async throws { // >SEPARATOR restoreApiKey // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.restoreApiKey( @@ -789,7 +789,7 @@ final class SearchClientSnippet { func snippetForSaveObject() async throws { // >SEPARATOR saveObject // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.saveObject( @@ -808,7 +808,7 @@ final class SearchClientSnippet { func snippetForSaveRule() async throws { // >SEPARATOR saveRule // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.saveRule( @@ -817,9 +817,9 @@ final class SearchClientSnippet { rule: Rule( objectID: "id1", conditions: [ - Condition( + SearchCondition( pattern: "apple", - anchoring: Anchoring.contains + anchoring: SearchAnchoring.contains ), ] ) @@ -833,7 +833,7 @@ final class SearchClientSnippet { func snippetForSaveRules() async throws { // >SEPARATOR saveRules // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.saveRules( @@ -842,18 +842,18 @@ final class SearchClientSnippet { Rule( objectID: "a-rule-id", conditions: [ - Condition( + SearchCondition( pattern: "smartphone", - anchoring: Anchoring.contains + anchoring: SearchAnchoring.contains ), ] ), Rule( objectID: "a-second-rule-id", conditions: [ - Condition( + SearchCondition( pattern: "apple", - anchoring: Anchoring.contains + anchoring: SearchAnchoring.contains ), ] ), @@ -868,7 +868,7 @@ final class SearchClientSnippet { func snippetForSaveSynonym() async throws { // >SEPARATOR saveSynonym // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.saveSynonym( @@ -894,7 +894,7 @@ final class SearchClientSnippet { func snippetForSaveSynonyms() async throws { // >SEPARATOR saveSynonyms // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.saveSynonyms( @@ -932,7 +932,7 @@ final class SearchClientSnippet { func snippetForSearch() async throws { // >SEPARATOR search // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client @@ -957,7 +957,7 @@ final class SearchClientSnippet { func snippetForSearchDictionaryEntries() async throws { // >SEPARATOR searchDictionaryEntries // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.searchDictionaryEntries( @@ -975,7 +975,7 @@ final class SearchClientSnippet { func snippetForSearchForFacetValues() async throws { // >SEPARATOR searchForFacetValues // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.searchForFacetValues( @@ -991,7 +991,7 @@ final class SearchClientSnippet { func snippetForSearchRules() async throws { // >SEPARATOR searchRules // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.searchRules( @@ -1009,7 +1009,7 @@ final class SearchClientSnippet { func snippetForSearchSingleIndex() async throws { // >SEPARATOR searchSingleIndex // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.searchSingleIndex( @@ -1024,7 +1024,7 @@ final class SearchClientSnippet { func snippetForSearchSynonyms() async throws { // >SEPARATOR searchSynonyms // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.searchSynonyms( @@ -1039,7 +1039,7 @@ final class SearchClientSnippet { func snippetForSearchUserIds() async throws { // >SEPARATOR searchUserIds // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.searchUserIds( @@ -1059,7 +1059,7 @@ final class SearchClientSnippet { func snippetForSetDictionarySettings() async throws { // >SEPARATOR setDictionarySettings // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client @@ -1083,7 +1083,7 @@ final class SearchClientSnippet { func snippetForSetSettings() async throws { // >SEPARATOR setSettings // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.setSettings( @@ -1102,7 +1102,7 @@ final class SearchClientSnippet { func snippetForUpdateApiKey() async throws { // >SEPARATOR updateApiKey // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.updateApiKey( diff --git a/specs/bundled/abtesting.doc.yml b/specs/bundled/abtesting.doc.yml index 04776718848..043130cfd12 100644 --- a/specs/bundled/abtesting.doc.yml +++ b/specs/bundled/abtesting.doc.yml @@ -695,7 +695,7 @@ paths: source: > // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -899,7 +899,7 @@ paths: source: > // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1103,7 +1103,7 @@ paths: source: > // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1307,7 +1307,7 @@ paths: source: > // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1622,7 +1622,7 @@ paths: source: > // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1859,7 +1859,7 @@ paths: source: > // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2063,7 +2063,7 @@ paths: source: > // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2268,7 +2268,7 @@ paths: source: > // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2477,7 +2477,7 @@ paths: source: > // Initialize the client - let client = try AbtestingClient(appId: "YOUR_APP_ID", apiKey: + let client = try AbtestingClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) diff --git a/specs/bundled/analytics.doc.yml b/specs/bundled/analytics.doc.yml index 96f0711a354..991a9baccea 100644 --- a/specs/bundled/analytics.doc.yml +++ b/specs/bundled/analytics.doc.yml @@ -709,7 +709,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -913,7 +913,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1117,7 +1117,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1321,7 +1321,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1534,7 +1534,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1763,7 +1763,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2002,7 +2002,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2241,7 +2241,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2484,7 +2484,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2731,7 +2731,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2940,7 +2940,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -3168,7 +3168,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -3386,7 +3386,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -3609,7 +3609,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -3827,7 +3827,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -4057,7 +4057,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -4305,7 +4305,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -4553,7 +4553,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -4802,7 +4802,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -5051,7 +5051,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -5265,7 +5265,7 @@ paths: source: > // Initialize the client - let client = try AnalyticsClient(appId: "YOUR_APP_ID", apiKey: + let client = try AnalyticsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) diff --git a/specs/bundled/ingestion.doc.yml b/specs/bundled/ingestion.doc.yml index 117a0ea2c23..fed7b95ef33 100644 --- a/specs/bundled/ingestion.doc.yml +++ b/specs/bundled/ingestion.doc.yml @@ -2061,7 +2061,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2265,7 +2265,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2469,7 +2469,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2673,7 +2673,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2883,7 +2883,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -3149,7 +3149,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -3404,7 +3404,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -3615,7 +3615,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -3841,7 +3841,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -4049,7 +4049,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -4259,7 +4259,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -4514,7 +4514,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -4767,7 +4767,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -4978,7 +4978,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -5204,7 +5204,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -5412,7 +5412,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -5621,7 +5621,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -5921,7 +5921,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -6180,7 +6180,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -6389,7 +6389,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -6614,7 +6614,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -6820,7 +6820,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -7037,7 +7037,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -7252,7 +7252,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -7465,7 +7465,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -7717,7 +7717,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -7981,7 +7981,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -8191,7 +8191,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -8412,7 +8412,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -8614,7 +8614,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -8818,7 +8818,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -9022,7 +9022,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -9226,7 +9226,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -9437,7 +9437,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -9639,7 +9639,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -9880,7 +9880,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -10093,7 +10093,7 @@ paths: source: > // Initialize the client - let client = try IngestionClient(appId: "YOUR_APP_ID", apiKey: + let client = try IngestionClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) diff --git a/specs/bundled/insights.doc.yml b/specs/bundled/insights.doc.yml index be10148c7e6..36c2c875eb8 100644 --- a/specs/bundled/insights.doc.yml +++ b/specs/bundled/insights.doc.yml @@ -1123,7 +1123,7 @@ paths: source: > // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1339,7 +1339,7 @@ paths: source: > // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1555,7 +1555,7 @@ paths: source: > // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1771,7 +1771,7 @@ paths: source: > // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2561,7 +2561,7 @@ paths: source: > // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2826,7 +2826,7 @@ paths: source: > // Initialize the client - let client = try InsightsClient(appId: "YOUR_APP_ID", apiKey: + let client = try InsightsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) diff --git a/specs/bundled/monitoring.doc.yml b/specs/bundled/monitoring.doc.yml index 7992fa8c2e1..6b83a8e71f0 100644 --- a/specs/bundled/monitoring.doc.yml +++ b/specs/bundled/monitoring.doc.yml @@ -765,7 +765,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -950,7 +950,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -1135,7 +1135,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -1320,7 +1320,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -1493,7 +1493,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -1679,7 +1679,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -1841,7 +1841,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -2027,7 +2027,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -2200,7 +2200,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -2370,7 +2370,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -2556,7 +2556,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -2742,7 +2742,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -2925,7 +2925,7 @@ paths: source: > // Initialize the client - let client = try MonitoringClient(appId: "YOUR_APP_ID", apiKey: + let client = try MonitoringClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") diff --git a/specs/bundled/personalization.doc.yml b/specs/bundled/personalization.doc.yml index 199dd409422..ca9f95cc8ce 100644 --- a/specs/bundled/personalization.doc.yml +++ b/specs/bundled/personalization.doc.yml @@ -343,7 +343,7 @@ paths: source: > // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -544,7 +544,7 @@ paths: source: > // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -745,7 +745,7 @@ paths: source: > // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -946,7 +946,7 @@ paths: source: > // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1176,7 +1176,7 @@ paths: source: > // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1409,7 +1409,7 @@ paths: source: > // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1600,7 +1600,7 @@ paths: source: > // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1908,7 +1908,7 @@ paths: source: > // Initialize the client - let client = try PersonalizationClient(appId: "YOUR_APP_ID", apiKey: + let client = try PersonalizationClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) diff --git a/specs/bundled/query-suggestions.doc.yml b/specs/bundled/query-suggestions.doc.yml index c192753e2be..6d55239e7b9 100644 --- a/specs/bundled/query-suggestions.doc.yml +++ b/specs/bundled/query-suggestions.doc.yml @@ -639,7 +639,7 @@ paths: source: > // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -834,7 +834,7 @@ paths: source: > // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1029,7 +1029,7 @@ paths: source: > // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1224,7 +1224,7 @@ paths: source: > // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1403,7 +1403,7 @@ paths: source: > // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1756,7 +1756,7 @@ paths: source: > // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -1784,7 +1784,7 @@ paths: ] ), ], - languages: Languages.arrayOfString( + languages: QuerySuggestionsLanguages.arrayOfString( [ "french", ] @@ -1982,7 +1982,7 @@ paths: source: > // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2334,7 +2334,7 @@ paths: source: > // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2342,7 +2342,7 @@ paths: _ = try await client.updateConfig( indexName: "theIndexName", - querySuggestionsConfiguration: QuerySuggestionsConfiguration( + configuration: QuerySuggestionsConfiguration( sourceIndices: [ SourceIndex( indexName: "testIndex", @@ -2362,7 +2362,7 @@ paths: ] ), ], - languages: Languages.arrayOfString( + languages: QuerySuggestionsLanguages.arrayOfString( [ "french", ] @@ -2570,7 +2570,7 @@ paths: source: > // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -2795,7 +2795,7 @@ paths: source: > // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) @@ -3017,7 +3017,7 @@ paths: source: > // Initialize the client - let client = try QuerySuggestionsClient(appId: "YOUR_APP_ID", + let client = try QuerySuggestionsClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY", region: .us) diff --git a/specs/bundled/recommend.doc.yml b/specs/bundled/recommend.doc.yml index 2d9fcdded81..65c4136b295 100644 --- a/specs/bundled/recommend.doc.yml +++ b/specs/bundled/recommend.doc.yml @@ -3123,7 +3123,7 @@ paths: source: > // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -3321,7 +3321,7 @@ paths: source: > // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -3519,7 +3519,7 @@ paths: source: > // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -3717,7 +3717,7 @@ paths: source: > // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -4039,7 +4039,7 @@ paths: source: > // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -4280,7 +4280,7 @@ paths: source: > // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -4505,7 +4505,7 @@ paths: source: > // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -4749,7 +4749,7 @@ paths: source: > // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -5020,7 +5020,7 @@ paths: source: > // Initialize the client - let client = try RecommendClient(appId: "YOUR_APP_ID", apiKey: + let client = try RecommendClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") diff --git a/specs/bundled/search.doc.yml b/specs/bundled/search.doc.yml index b38ec6c1ecf..3c7cd83b558 100644 --- a/specs/bundled/search.doc.yml +++ b/specs/bundled/search.doc.yml @@ -4711,7 +4711,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -4901,7 +4901,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -5091,7 +5091,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -5281,7 +5281,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -5499,7 +5499,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -5779,7 +5779,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -6028,7 +6028,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -6247,7 +6247,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -6516,7 +6516,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -6728,7 +6728,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -6985,7 +6985,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -7239,7 +7239,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -7444,7 +7444,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -7673,7 +7673,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -7868,7 +7868,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -8170,7 +8170,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -8505,7 +8505,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -8853,7 +8853,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -9200,7 +9200,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -9405,7 +9405,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -9638,7 +9638,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -9842,7 +9842,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -10137,7 +10137,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -10345,7 +10345,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -10705,7 +10705,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -10919,7 +10919,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -11140,7 +11140,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -11328,7 +11328,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -11588,7 +11588,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -11791,7 +11791,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -12070,7 +12070,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -12273,7 +12273,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -12471,7 +12471,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -12672,7 +12672,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -12958,7 +12958,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -12970,9 +12970,9 @@ paths: rule: Rule( objectID: "id1", conditions: [ - Condition( + SearchCondition( pattern: "apple", - anchoring: Anchoring.contains + anchoring: SearchAnchoring.contains ), ] ) @@ -13164,7 +13164,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -13530,7 +13530,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -13542,18 +13542,18 @@ paths: Rule( objectID: "a-rule-id", conditions: [ - Condition( + SearchCondition( pattern: "smartphone", - anchoring: Anchoring.contains + anchoring: SearchAnchoring.contains ), ] ), Rule( objectID: "a-second-rule-id", conditions: [ - Condition( + SearchCondition( pattern: "apple", - anchoring: Anchoring.contains + anchoring: SearchAnchoring.contains ), ] ), @@ -13741,7 +13741,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -14014,7 +14014,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -14390,7 +14390,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -14651,7 +14651,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -14839,7 +14839,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -15101,7 +15101,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -15296,7 +15296,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -15527,7 +15527,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -15725,7 +15725,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -15991,7 +15991,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -16200,7 +16200,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -16393,7 +16393,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -16587,7 +16587,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -16776,7 +16776,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -17096,7 +17096,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -17315,7 +17315,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -17489,7 +17489,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -17732,7 +17732,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -17740,7 +17740,7 @@ paths: _ = try await client.replaceSources( source: [ - Source( + SearchSource( source: "theSource", description: "theDescription" ), @@ -17952,14 +17952,14 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") // Call the API _ = try await client.appendSource( - source: Source( + source: SearchSource( source: "theSource", description: "theDescription" ) @@ -18156,7 +18156,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -18512,7 +18512,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -18734,7 +18734,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -19063,7 +19063,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") @@ -19255,7 +19255,7 @@ paths: source: > // Initialize the client - let client = try SearchClient(appId: "YOUR_APP_ID", apiKey: + let client = try SearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY") diff --git a/tests/output/csharp/src/generated/requests/Insights.test.cs b/tests/output/csharp/src/generated/requests/Insights.test.cs index 2254d343c17..f878cd861df 100644 --- a/tests/output/csharp/src/generated/requests/Insights.test.cs +++ b/tests/output/csharp/src/generated/requests/Insights.test.cs @@ -601,7 +601,7 @@ await _client.PushEventsAsync( Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1710201600000L, + Timestamp = 1710720000000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, QueryID = "43b15df305339e827f0ac0bdc5ebcaa7", } @@ -614,7 +614,7 @@ await _client.PushEventsAsync( Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1710201600000L, + Timestamp = 1710720000000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, } ) @@ -626,7 +626,7 @@ await _client.PushEventsAsync( Assert.Equal("/1/events", req.Path); Assert.Equal("POST", req.Method.ToString()); JsonAssert.EqualOverrideDefault( - "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710201600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710201600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", + "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710720000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710720000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", req.Body, new JsonDiffConfig(false) ); @@ -647,7 +647,7 @@ await _client.PushEventsAsync( Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1710201600000L, + Timestamp = 1710720000000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, QueryID = "43b15df305339e827f0ac0bdc5ebcaa7", } @@ -660,7 +660,7 @@ await _client.PushEventsAsync( Index = "products", UserToken = "user-123456", AuthenticatedUserToken = "user-123456", - Timestamp = 1710201600000L, + Timestamp = 1710720000000L, ObjectIDs = new List { "9780545139700", "9780439784542" }, } ) diff --git a/tests/output/dart/test/requests/insights_test.dart b/tests/output/dart/test/requests/insights_test.dart index 7abc78d3fb1..4ff8db98157 100644 --- a/tests/output/dart/test/requests/insights_test.dart +++ b/tests/output/dart/test/requests/insights_test.dart @@ -632,7 +632,7 @@ void main() { index: "products", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: 1710201600000, + timestamp: 1710720000000, objectIDs: [ "9780545139700", "9780439784542", @@ -645,7 +645,7 @@ void main() { index: "products", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: 1710201600000, + timestamp: 1710720000000, objectIDs: [ "9780545139700", "9780439784542", @@ -658,7 +658,7 @@ void main() { expectPath(request.path, '/1/events'); expect(request.method, 'post'); expectBody(request.body, - """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"]}]}"""); + """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"]}]}"""); }, ), ); diff --git a/tests/output/go/tests/requests/insights_test.go b/tests/output/go/tests/requests/insights_test.go index 84dea20cb12..40fcf63719d 100644 --- a/tests/output/go/tests/requests/insights_test.go +++ b/tests/output/go/tests/requests/insights_test.go @@ -451,9 +451,9 @@ func TestInsights_PushEvents(t *testing.T) { insights.NewEmptyInsightsEvents().SetEvents( []insights.EventsItems{*insights.ConvertedObjectIDsAfterSearchAsEventsItems( - insights.NewEmptyConvertedObjectIDsAfterSearch().SetEventType(insights.ConversionEvent("conversion")).SetEventName("Product Purchased").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1710201600000).SetObjectIDs( + insights.NewEmptyConvertedObjectIDsAfterSearch().SetEventType(insights.ConversionEvent("conversion")).SetEventName("Product Purchased").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1710720000000).SetObjectIDs( []string{"9780545139700", "9780439784542"}).SetQueryID("43b15df305339e827f0ac0bdc5ebcaa7")), *insights.ViewedObjectIDsAsEventsItems( - insights.NewEmptyViewedObjectIDs().SetEventType(insights.ViewEvent("view")).SetEventName("Product Detail Page Viewed").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1710201600000).SetObjectIDs( + insights.NewEmptyViewedObjectIDs().SetEventType(insights.ViewEvent("view")).SetEventName("Product Detail Page Viewed").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1710720000000).SetObjectIDs( []string{"9780545139700", "9780439784542"}))}), )) require.NoError(t, err) @@ -462,15 +462,15 @@ func TestInsights_PushEvents(t *testing.T) { require.Equal(t, "POST", echo.Method) ja := jsonassert.New(t) - ja.Assertf(*echo.Body, `{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"]}]}`) + ja.Assertf(*echo.Body, `{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"]}]}`) clientE2E := createE2EInsightsClient(t) res, err := clientE2E.PushEvents(client.NewApiPushEventsRequest( insights.NewEmptyInsightsEvents().SetEvents( []insights.EventsItems{*insights.ConvertedObjectIDsAfterSearchAsEventsItems( - insights.NewEmptyConvertedObjectIDsAfterSearch().SetEventType(insights.ConversionEvent("conversion")).SetEventName("Product Purchased").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1710201600000).SetObjectIDs( + insights.NewEmptyConvertedObjectIDsAfterSearch().SetEventType(insights.ConversionEvent("conversion")).SetEventName("Product Purchased").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1710720000000).SetObjectIDs( []string{"9780545139700", "9780439784542"}).SetQueryID("43b15df305339e827f0ac0bdc5ebcaa7")), *insights.ViewedObjectIDsAsEventsItems( - insights.NewEmptyViewedObjectIDs().SetEventType(insights.ViewEvent("view")).SetEventName("Product Detail Page Viewed").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1710201600000).SetObjectIDs( + insights.NewEmptyViewedObjectIDs().SetEventType(insights.ViewEvent("view")).SetEventName("Product Detail Page Viewed").SetIndex("products").SetUserToken("user-123456").SetAuthenticatedUserToken("user-123456").SetTimestamp(1710720000000).SetObjectIDs( []string{"9780545139700", "9780439784542"}))}), )) require.NoError(t, err) diff --git a/tests/output/java/src/test/java/com/algolia/requests/Insights.test.java b/tests/output/java/src/test/java/com/algolia/requests/Insights.test.java index d5c2b63c26a..6ebbd27a243 100644 --- a/tests/output/java/src/test/java/com/algolia/requests/Insights.test.java +++ b/tests/output/java/src/test/java/com/algolia/requests/Insights.test.java @@ -615,7 +615,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1710201600000L) + .setTimestamp(1710720000000L) .setObjectIDs(List.of("9780545139700", "9780439784542")) .setQueryID("43b15df305339e827f0ac0bdc5ebcaa7"), new ViewedObjectIDs() @@ -624,7 +624,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1710201600000L) + .setTimestamp(1710720000000L) .setObjectIDs(List.of("9780545139700", "9780439784542")) ) ) @@ -636,9 +636,9 @@ void pushEventsTest1() { assertDoesNotThrow(() -> JSONAssert.assertEquals( "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product" + - " Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710201600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product" + + " Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710720000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product" + " Detail Page" + - " Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710201600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", + " Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710720000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}", req.body, JSONCompareMode.STRICT ) @@ -654,7 +654,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1710201600000L) + .setTimestamp(1710720000000L) .setObjectIDs(List.of("9780545139700", "9780439784542")) .setQueryID("43b15df305339e827f0ac0bdc5ebcaa7"), new ViewedObjectIDs() @@ -663,7 +663,7 @@ void pushEventsTest1() { .setIndex("products") .setUserToken("user-123456") .setAuthenticatedUserToken("user-123456") - .setTimestamp(1710201600000L) + .setTimestamp(1710720000000L) .setObjectIDs(List.of("9780545139700", "9780439784542")) ) ) diff --git a/tests/output/javascript/src/requests/insights.test.ts b/tests/output/javascript/src/requests/insights.test.ts index 2b5ba3771d0..992e04bb26c 100644 --- a/tests/output/javascript/src/requests/insights.test.ts +++ b/tests/output/javascript/src/requests/insights.test.ts @@ -426,7 +426,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1710201600000, + timestamp: 1710720000000, objectIDs: ['9780545139700', '9780439784542'], queryID: '43b15df305339e827f0ac0bdc5ebcaa7', }, @@ -436,7 +436,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1710201600000, + timestamp: 1710720000000, objectIDs: ['9780545139700', '9780439784542'], }, ], @@ -452,7 +452,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1710201600000, + timestamp: 1710720000000, objectIDs: ['9780545139700', '9780439784542'], queryID: '43b15df305339e827f0ac0bdc5ebcaa7', }, @@ -462,7 +462,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1710201600000, + timestamp: 1710720000000, objectIDs: ['9780545139700', '9780439784542'], }, ], @@ -477,7 +477,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1710201600000, + timestamp: 1710720000000, objectIDs: ['9780545139700', '9780439784542'], queryID: '43b15df305339e827f0ac0bdc5ebcaa7', }, @@ -487,7 +487,7 @@ describe('pushEvents', () => { index: 'products', userToken: 'user-123456', authenticatedUserToken: 'user-123456', - timestamp: 1710201600000, + timestamp: 1710720000000, objectIDs: ['9780545139700', '9780439784542'], }, ], diff --git a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/InsightsTest.kt b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/InsightsTest.kt index ba6abd97665..935af95af7c 100644 --- a/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/InsightsTest.kt +++ b/tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/InsightsTest.kt @@ -528,7 +528,7 @@ class InsightsTest { index = "products", userToken = "user-123456", authenticatedUserToken = "user-123456", - timestamp = 1710201600000L, + timestamp = 1710720000000L, objectIDs = listOf("9780545139700", "9780439784542"), queryID = "43b15df305339e827f0ac0bdc5ebcaa7", ), @@ -538,7 +538,7 @@ class InsightsTest { index = "products", userToken = "user-123456", authenticatedUserToken = "user-123456", - timestamp = 1710201600000L, + timestamp = 1710720000000L, objectIDs = listOf("9780545139700", "9780439784542"), ), ), @@ -548,7 +548,7 @@ class InsightsTest { intercept = { assertEquals("/1/events".toPathSegments(), it.url.pathSegments) assertEquals(HttpMethod.parse("POST"), it.method) - assertJsonBody("""{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"]}]}""", it.body) + assertJsonBody("""{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"]}]}""", it.body) }, ) } diff --git a/tests/output/php/src/requests/InsightsTest.php b/tests/output/php/src/requests/InsightsTest.php index 6ba43264d17..031b0ca488d 100644 --- a/tests/output/php/src/requests/InsightsTest.php +++ b/tests/output/php/src/requests/InsightsTest.php @@ -630,7 +630,7 @@ public function testPushEvents1() 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1710201600000, + 'timestamp' => 1710720000000, 'objectIDs' => [ '9780545139700', @@ -644,7 +644,7 @@ public function testPushEvents1() 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1710201600000, + 'timestamp' => 1710720000000, 'objectIDs' => [ '9780545139700', @@ -659,7 +659,7 @@ public function testPushEvents1() [ 'path' => '/1/events', 'method' => 'POST', - 'body' => json_decode('{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"]}]}'), + 'body' => json_decode('{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"]}]}'), ], ]); @@ -671,7 +671,7 @@ public function testPushEvents1() 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1710201600000, + 'timestamp' => 1710720000000, 'objectIDs' => [ '9780545139700', @@ -685,7 +685,7 @@ public function testPushEvents1() 'index' => 'products', 'userToken' => 'user-123456', 'authenticatedUserToken' => 'user-123456', - 'timestamp' => 1710201600000, + 'timestamp' => 1710720000000, 'objectIDs' => [ '9780545139700', diff --git a/tests/output/python/tests/requests/insights_test.py b/tests/output/python/tests/requests/insights_test.py index 962ce97dc4d..4126752624d 100644 --- a/tests/output/python/tests/requests/insights_test.py +++ b/tests/output/python/tests/requests/insights_test.py @@ -478,7 +478,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1710201600000, + "timestamp": 1710720000000, "objectIDs": [ "9780545139700", "9780439784542", @@ -491,7 +491,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1710201600000, + "timestamp": 1710720000000, "objectIDs": [ "9780545139700", "9780439784542", @@ -506,7 +506,7 @@ async def test_push_events_1(self): assert _req.query_parameters.items() == {}.items() assert _req.headers.items() >= {}.items() assert loads(_req.data) == loads( - """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"]}]}""" + """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"]}]}""" ) raw_resp = await InsightsClient( @@ -520,7 +520,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1710201600000, + "timestamp": 1710720000000, "objectIDs": [ "9780545139700", "9780439784542", @@ -533,7 +533,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1710201600000, + "timestamp": 1710720000000, "objectIDs": [ "9780545139700", "9780439784542", @@ -555,7 +555,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1710201600000, + "timestamp": 1710720000000, "objectIDs": [ "9780545139700", "9780439784542", @@ -568,7 +568,7 @@ async def test_push_events_1(self): "index": "products", "userToken": "user-123456", "authenticatedUserToken": "user-123456", - "timestamp": 1710201600000, + "timestamp": 1710720000000, "objectIDs": [ "9780545139700", "9780439784542", diff --git a/tests/output/ruby/test/requests/insights_test.rb b/tests/output/ruby/test/requests/insights_test.rb index 39134368d58..0797f7bb057 100644 --- a/tests/output/ruby/test/requests/insights_test.rb +++ b/tests/output/ruby/test/requests/insights_test.rb @@ -364,7 +364,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_710_201_600_000, + timestamp: 1_710_720_000_000, object_ids: ["9780545139700", "9780439784542"], query_id: "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -374,7 +374,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_710_201_600_000, + timestamp: 1_710_720_000_000, object_ids: ["9780545139700", "9780439784542"] ) ] @@ -386,7 +386,7 @@ def test_push_events1 assert_equal({}.to_a, req.query_params.to_a) assert(({}.to_a - req.headers.to_a).empty?, req.headers.to_s) assert_equal( - JSON.parse('{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"]}]}'), JSON.parse(req.body) + JSON.parse('{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"]}]}'), JSON.parse(req.body) ) res = @e2e_client.push_events_with_http_info( @@ -398,7 +398,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_710_201_600_000, + timestamp: 1_710_720_000_000, object_ids: ["9780545139700", "9780439784542"], query_id: "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -408,7 +408,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_710_201_600_000, + timestamp: 1_710_720_000_000, object_ids: ["9780545139700", "9780439784542"] ) ] @@ -425,7 +425,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_710_201_600_000, + timestamp: 1_710_720_000_000, object_ids: ["9780545139700", "9780439784542"], query_id: "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -435,7 +435,7 @@ def test_push_events1 index: "products", user_token: "user-123456", authenticated_user_token: "user-123456", - timestamp: 1_710_201_600_000, + timestamp: 1_710_720_000_000, object_ids: ["9780545139700", "9780439784542"] ) ] diff --git a/tests/output/scala/src/test/scala/algoliasearch/requests/InsightsTest.scala b/tests/output/scala/src/test/scala/algoliasearch/requests/InsightsTest.scala index cab73d7e4c9..d2006ded5ef 100644 --- a/tests/output/scala/src/test/scala/algoliasearch/requests/InsightsTest.scala +++ b/tests/output/scala/src/test/scala/algoliasearch/requests/InsightsTest.scala @@ -596,7 +596,7 @@ class InsightsTest extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1710201600000L), + timestamp = Some(1710720000000L), objectIDs = Seq("9780545139700", "9780439784542"), queryID = "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -606,7 +606,7 @@ class InsightsTest extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1710201600000L), + timestamp = Some(1710720000000L), objectIDs = Seq("9780545139700", "9780439784542") ) ) @@ -619,7 +619,7 @@ class InsightsTest extends AnyFunSuite { assert(res.path == "/1/events") assert(res.method == "POST") val expectedBody = parse( - """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710201600000,"objectIDs":["9780545139700","9780439784542"]}]}""" + """{"events":[{"eventType":"conversion","eventName":"Product Purchased","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"],"queryID":"43b15df305339e827f0ac0bdc5ebcaa7"},{"eventType":"view","eventName":"Product Detail Page Viewed","index":"products","userToken":"user-123456","authenticatedUserToken":"user-123456","timestamp":1710720000000,"objectIDs":["9780545139700","9780439784542"]}]}""" ) val actualBody = parse(res.body.get) assert(actualBody == expectedBody) @@ -633,7 +633,7 @@ class InsightsTest extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1710201600000L), + timestamp = Some(1710720000000L), objectIDs = Seq("9780545139700", "9780439784542"), queryID = "43b15df305339e827f0ac0bdc5ebcaa7" ), @@ -643,7 +643,7 @@ class InsightsTest extends AnyFunSuite { index = "products", userToken = "user-123456", authenticatedUserToken = Some("user-123456"), - timestamp = Some(1710201600000L), + timestamp = Some(1710720000000L), objectIDs = Seq("9780545139700", "9780439784542") ) ) diff --git a/tests/output/swift/Package.swift b/tests/output/swift/Package.swift index 9828a00d488..50340456a44 100644 --- a/tests/output/swift/Package.swift +++ b/tests/output/swift/Package.swift @@ -44,10 +44,9 @@ let libraries: [Target.Dependency] = [ let package = Package( name: "AlgoliaSearchClientTests", platforms: [ - .macOS(.v10_15), + .macOS(.v11), ], dependencies: [ - .package(url: "https://github.com/Flight-School/AnyCodable", from: "0.6.7"), .package(url: "https://github.com/swiftpackages/DotEnv.git", from: "3.0.0"), .package(path: "../../../clients/algoliasearch-client-swift"), ], @@ -55,7 +54,6 @@ let package = Package( .target( name: "Utils", dependencies: [ - .product(name: "AnyCodable", package: "AnyCodable"), .product(name: "Core", package: "algoliasearch-client-swift"), .product(name: "Search", package: "algoliasearch-client-swift"), ], @@ -64,14 +62,12 @@ let package = Package( .testTarget( name: "client", dependencies: [ - .product(name: "AnyCodable", package: "AnyCodable"), .target(name: "Utils"), ] + libraries ), .testTarget( name: "requests", dependencies: [ - .product(name: "AnyCodable", package: "AnyCodable"), .product(name: "DotEnv", package: "DotEnv"), .target(name: "Utils"), ] + libraries @@ -79,7 +75,6 @@ let package = Package( .testTarget( name: "handwritten", dependencies: [ - .product(name: "AnyCodable", package: "AnyCodable"), .product(name: "DotEnv", package: "DotEnv"), .target(name: "Utils"), .product(name: "Core", package: "algoliasearch-client-swift"), diff --git a/tests/output/swift/Tests/client/AbtestingTests.swift b/tests/output/swift/Tests/client/AbtestingTests.swift index e3766a5001f..622bfb7e48b 100644 --- a/tests/output/swift/Tests/client/AbtestingTests.swift +++ b/tests/output/swift/Tests/client/AbtestingTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Abtesting @@ -12,11 +11,7 @@ final class AbtestingClientClientTests: XCTestCase { /// calls api with correct user agent func testCommonApiTest0() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try AbtestingClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = AbtestingClient(configuration: configuration, transporter: transporter) @@ -43,11 +38,7 @@ final class AbtestingClientClientTests: XCTestCase { /// calls api with default read timeouts func testCommonApiTest1() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try AbtestingClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = AbtestingClient(configuration: configuration, transporter: transporter) @@ -62,11 +53,7 @@ final class AbtestingClientClientTests: XCTestCase { /// calls api with default write timeouts func testCommonApiTest2() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try AbtestingClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = AbtestingClient(configuration: configuration, transporter: transporter) @@ -81,11 +68,7 @@ final class AbtestingClientClientTests: XCTestCase { /// fallbacks to the alias when region is not given func testParametersTest0() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( - appID: "my-app-id", - apiKey: "my-api-key", - region: nil - ) + let configuration = try AbtestingClientConfiguration(appID: "my-app-id", apiKey: "my-api-key", region: nil) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = AbtestingClient(configuration: configuration, transporter: transporter) let response = try await client.getABTestWithHTTPInfo( @@ -99,7 +82,7 @@ final class AbtestingClientClientTests: XCTestCase { /// uses the correct region func testParametersTest1() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "us") @@ -118,7 +101,7 @@ final class AbtestingClientClientTests: XCTestCase { /// throws when incorrect region is given func testParametersTest2() async throws { do { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "not_a_region") diff --git a/tests/output/swift/Tests/client/AnalyticsTests.swift b/tests/output/swift/Tests/client/AnalyticsTests.swift index 10bc9448778..c3a46816b35 100644 --- a/tests/output/swift/Tests/client/AnalyticsTests.swift +++ b/tests/output/swift/Tests/client/AnalyticsTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Analytics @@ -12,11 +11,7 @@ final class AnalyticsClientClientTests: XCTestCase { /// calls api with correct user agent func testCommonApiTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try AnalyticsClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = AnalyticsClient(configuration: configuration, transporter: transporter) @@ -43,11 +38,7 @@ final class AnalyticsClientClientTests: XCTestCase { /// calls api with default read timeouts func testCommonApiTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try AnalyticsClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = AnalyticsClient(configuration: configuration, transporter: transporter) @@ -62,11 +53,7 @@ final class AnalyticsClientClientTests: XCTestCase { /// calls api with default write timeouts func testCommonApiTest2() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try AnalyticsClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = AnalyticsClient(configuration: configuration, transporter: transporter) @@ -81,11 +68,7 @@ final class AnalyticsClientClientTests: XCTestCase { /// fallbacks to the alias when region is not given func testParametersTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( - appID: "my-app-id", - apiKey: "my-api-key", - region: nil - ) + let configuration = try AnalyticsClientConfiguration(appID: "my-app-id", apiKey: "my-api-key", region: nil) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = AnalyticsClient(configuration: configuration, transporter: transporter) let response = try await client.getAverageClickPositionWithHTTPInfo( @@ -99,7 +82,7 @@ final class AnalyticsClientClientTests: XCTestCase { /// uses the correct region func testParametersTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "de") @@ -118,7 +101,7 @@ final class AnalyticsClientClientTests: XCTestCase { /// throws when incorrect region is given func testParametersTest2() async throws { do { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "not_a_region") @@ -134,11 +117,7 @@ final class AnalyticsClientClientTests: XCTestCase { /// getAverageClickPosition throws without index func testParametersTest3() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try AnalyticsClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = AnalyticsClient(configuration: configuration, transporter: transporter) diff --git a/tests/output/swift/Tests/client/IngestionTests.swift b/tests/output/swift/Tests/client/IngestionTests.swift index 1b8f23d1003..1b2a78385a8 100644 --- a/tests/output/swift/Tests/client/IngestionTests.swift +++ b/tests/output/swift/Tests/client/IngestionTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Core @@ -12,11 +11,7 @@ final class IngestionClientClientTests: XCTestCase { /// calls api with correct user agent func testCommonApiTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try IngestionClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = IngestionClient(configuration: configuration, transporter: transporter) @@ -43,11 +38,7 @@ final class IngestionClientClientTests: XCTestCase { /// calls api with default read timeouts func testCommonApiTest1() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try IngestionClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = IngestionClient(configuration: configuration, transporter: transporter) @@ -62,11 +53,7 @@ final class IngestionClientClientTests: XCTestCase { /// calls api with default write timeouts func testCommonApiTest2() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try IngestionClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = IngestionClient(configuration: configuration, transporter: transporter) @@ -81,7 +68,7 @@ final class IngestionClientClientTests: XCTestCase { /// uses the correct region func testParametersTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "us") @@ -100,7 +87,7 @@ final class IngestionClientClientTests: XCTestCase { /// throws when incorrect region is given func testParametersTest1() async throws { do { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "not_a_region") diff --git a/tests/output/swift/Tests/client/InsightsTests.swift b/tests/output/swift/Tests/client/InsightsTests.swift index 07df7f2194f..7d0632672f2 100644 --- a/tests/output/swift/Tests/client/InsightsTests.swift +++ b/tests/output/swift/Tests/client/InsightsTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Core @@ -12,11 +11,7 @@ final class InsightsClientClientTests: XCTestCase { /// calls api with correct user agent func testCommonApiTest0() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try InsightsClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = InsightsClient(configuration: configuration, transporter: transporter) @@ -43,11 +38,7 @@ final class InsightsClientClientTests: XCTestCase { /// calls api with default read timeouts func testCommonApiTest1() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try InsightsClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = InsightsClient(configuration: configuration, transporter: transporter) @@ -62,11 +53,7 @@ final class InsightsClientClientTests: XCTestCase { /// calls api with default write timeouts func testCommonApiTest2() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, - region: Region.us - ) + let configuration = try InsightsClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY, region: Region.us) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = InsightsClient(configuration: configuration, transporter: transporter) @@ -81,11 +68,7 @@ final class InsightsClientClientTests: XCTestCase { /// fallbacks to the alias when region is not given func testParametersTest0() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( - appID: "my-app-id", - apiKey: "my-api-key", - region: nil - ) + let configuration = try InsightsClientConfiguration(appID: "my-app-id", apiKey: "my-api-key", region: nil) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = InsightsClient(configuration: configuration, transporter: transporter) let response = try await client.pushEventsWithHTTPInfo( @@ -119,7 +102,7 @@ final class InsightsClientClientTests: XCTestCase { /// uses the correct region func testParametersTest1() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "us") @@ -138,7 +121,7 @@ final class InsightsClientClientTests: XCTestCase { /// throws when incorrect region is given func testParametersTest2() async throws { do { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "not_a_region") diff --git a/tests/output/swift/Tests/client/MonitoringTests.swift b/tests/output/swift/Tests/client/MonitoringTests.swift index a14fdd17e41..a21254eb80a 100644 --- a/tests/output/swift/Tests/client/MonitoringTests.swift +++ b/tests/output/swift/Tests/client/MonitoringTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Core @@ -12,10 +11,7 @@ final class MonitoringClientClientTests: XCTestCase { /// calls api with correct user agent func testCommonApiTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY - ) + let configuration = try MonitoringClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = MonitoringClient(configuration: configuration, transporter: transporter) @@ -42,10 +38,7 @@ final class MonitoringClientClientTests: XCTestCase { /// calls api with default read timeouts func testCommonApiTest1() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY - ) + let configuration = try MonitoringClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = MonitoringClient(configuration: configuration, transporter: transporter) @@ -60,10 +53,7 @@ final class MonitoringClientClientTests: XCTestCase { /// calls api with default write timeouts func testCommonApiTest2() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY - ) + let configuration = try MonitoringClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = MonitoringClient(configuration: configuration, transporter: transporter) @@ -78,10 +68,7 @@ final class MonitoringClientClientTests: XCTestCase { /// use the correct host func testParametersTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( - appID: "my-app-id", - apiKey: "my-api-key" - ) + let configuration = try MonitoringClientConfiguration(appID: "my-app-id", apiKey: "my-api-key") let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = MonitoringClient(configuration: configuration, transporter: transporter) let response = try await client.customDeleteWithHTTPInfo( diff --git a/tests/output/swift/Tests/client/PersonalizationTests.swift b/tests/output/swift/Tests/client/PersonalizationTests.swift index a18ed6168e5..a7b69394f36 100644 --- a/tests/output/swift/Tests/client/PersonalizationTests.swift +++ b/tests/output/swift/Tests/client/PersonalizationTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Core @@ -12,9 +11,9 @@ final class PersonalizationClientClientTests: XCTestCase { /// calls api with correct user agent func testCommonApiTest0() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, + let configuration = try PersonalizationClientConfiguration( + appID: APPLICATION_ID, + apiKey: API_KEY, region: Region.us ) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) @@ -43,9 +42,9 @@ final class PersonalizationClientClientTests: XCTestCase { /// calls api with default read timeouts func testCommonApiTest1() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, + let configuration = try PersonalizationClientConfiguration( + appID: APPLICATION_ID, + apiKey: API_KEY, region: Region.us ) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) @@ -62,9 +61,9 @@ final class PersonalizationClientClientTests: XCTestCase { /// calls api with default write timeouts func testCommonApiTest2() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, + let configuration = try PersonalizationClientConfiguration( + appID: APPLICATION_ID, + apiKey: API_KEY, region: Region.us ) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) @@ -82,7 +81,7 @@ final class PersonalizationClientClientTests: XCTestCase { /// throws when region is not given func testParametersTest0() async throws { do { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "") @@ -99,7 +98,7 @@ final class PersonalizationClientClientTests: XCTestCase { /// throws when incorrect region is given func testParametersTest1() async throws { do { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "not_a_region") @@ -115,7 +114,7 @@ final class PersonalizationClientClientTests: XCTestCase { /// does not throw when region is given func testParametersTest2() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "us") diff --git a/tests/output/swift/Tests/client/QuerySuggestionsTests.swift b/tests/output/swift/Tests/client/QuerySuggestionsTests.swift index 21a895b435d..92b463bbdb7 100644 --- a/tests/output/swift/Tests/client/QuerySuggestionsTests.swift +++ b/tests/output/swift/Tests/client/QuerySuggestionsTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Core @@ -12,9 +11,9 @@ final class QuerySuggestionsClientClientTests: XCTestCase { /// calls api with correct user agent func testCommonApiTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, + let configuration = try QuerySuggestionsClientConfiguration( + appID: APPLICATION_ID, + apiKey: API_KEY, region: Region.us ) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) @@ -43,9 +42,9 @@ final class QuerySuggestionsClientClientTests: XCTestCase { /// calls api with default read timeouts func testCommonApiTest1() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, + let configuration = try QuerySuggestionsClientConfiguration( + appID: APPLICATION_ID, + apiKey: API_KEY, region: Region.us ) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) @@ -62,9 +61,9 @@ final class QuerySuggestionsClientClientTests: XCTestCase { /// calls api with default write timeouts func testCommonApiTest2() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY, + let configuration = try QuerySuggestionsClientConfiguration( + appID: APPLICATION_ID, + apiKey: API_KEY, region: Region.us ) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) @@ -82,7 +81,7 @@ final class QuerySuggestionsClientClientTests: XCTestCase { /// throws when region is not given func testParametersTest0() async throws { do { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "") @@ -99,7 +98,7 @@ final class QuerySuggestionsClientClientTests: XCTestCase { /// throws when incorrect region is given func testParametersTest1() async throws { do { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "not_a_region") @@ -115,7 +114,7 @@ final class QuerySuggestionsClientClientTests: XCTestCase { /// does not throw when region is given func testParametersTest2() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: "my-app-id", apiKey: "my-api-key", region: Region(rawValue: "us") diff --git a/tests/output/swift/Tests/client/RecommendTests.swift b/tests/output/swift/Tests/client/RecommendTests.swift index 45750c17675..74d7e95376e 100644 --- a/tests/output/swift/Tests/client/RecommendTests.swift +++ b/tests/output/swift/Tests/client/RecommendTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Core @@ -12,10 +11,7 @@ final class RecommendClientClientTests: XCTestCase { /// calls api with correct read host func testApiTest0() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( - appID: "test-app-id", - apiKey: "test-api-key" - ) + let configuration = try RecommendClientConfiguration(appID: "test-app-id", apiKey: "test-api-key") let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = RecommendClient(configuration: configuration, transporter: transporter) let response = try await client.customGetWithHTTPInfo( @@ -29,10 +25,7 @@ final class RecommendClientClientTests: XCTestCase { /// calls api with correct write host func testApiTest1() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( - appID: "test-app-id", - apiKey: "test-api-key" - ) + let configuration = try RecommendClientConfiguration(appID: "test-app-id", apiKey: "test-api-key") let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = RecommendClient(configuration: configuration, transporter: transporter) let response = try await client.customPostWithHTTPInfo( @@ -46,10 +39,7 @@ final class RecommendClientClientTests: XCTestCase { /// calls api with correct user agent func testCommonApiTest0() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY - ) + let configuration = try RecommendClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = RecommendClient(configuration: configuration, transporter: transporter) @@ -76,10 +66,7 @@ final class RecommendClientClientTests: XCTestCase { /// calls api with default read timeouts func testCommonApiTest1() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY - ) + let configuration = try RecommendClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = RecommendClient(configuration: configuration, transporter: transporter) @@ -94,10 +81,7 @@ final class RecommendClientClientTests: XCTestCase { /// calls api with default write timeouts func testCommonApiTest2() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY - ) + let configuration = try RecommendClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = RecommendClient(configuration: configuration, transporter: transporter) diff --git a/tests/output/swift/Tests/client/SearchTests.swift b/tests/output/swift/Tests/client/SearchTests.swift index 011da62d6be..8ddad593126 100644 --- a/tests/output/swift/Tests/client/SearchTests.swift +++ b/tests/output/swift/Tests/client/SearchTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Core @@ -12,10 +11,7 @@ final class SearchClientClientTests: XCTestCase { /// calls api with correct read host func testApiTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( - appID: "test-app-id", - apiKey: "test-api-key" - ) + let configuration = try SearchClientConfiguration(appID: "test-app-id", apiKey: "test-api-key") let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) let response = try await client.customGetWithHTTPInfo( @@ -29,10 +25,7 @@ final class SearchClientClientTests: XCTestCase { /// calls api with correct write host func testApiTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( - appID: "test-app-id", - apiKey: "test-api-key" - ) + let configuration = try SearchClientConfiguration(appID: "test-app-id", apiKey: "test-api-key") let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) let response = try await client.customPostWithHTTPInfo( @@ -46,7 +39,7 @@ final class SearchClientClientTests: XCTestCase { /// tests the retry strategy func testApiTest2() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: "test-app-id", apiKey: "test-api-key", hosts: [ @@ -69,7 +62,7 @@ final class SearchClientClientTests: XCTestCase { /// test the compression strategy func testApiTest3() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: "test-app-id", apiKey: "test-api-key", hosts: [RetryableHost(url: URL(string: "http://localhost:6678")!)], @@ -98,10 +91,7 @@ final class SearchClientClientTests: XCTestCase { /// calls api with correct user agent func testCommonApiTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY - ) + let configuration = try SearchClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) @@ -128,10 +118,7 @@ final class SearchClientClientTests: XCTestCase { /// calls api with default read timeouts func testCommonApiTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY - ) + let configuration = try SearchClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) @@ -146,10 +133,7 @@ final class SearchClientClientTests: XCTestCase { /// calls api with default write timeouts func testCommonApiTest2() async throws { - let configuration: Search.Configuration = try Search.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY - ) + let configuration = try SearchClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) @@ -165,7 +149,7 @@ final class SearchClientClientTests: XCTestCase { /// client throws with invalid parameters func testParametersTest0() async throws { do { - let configuration: Search.Configuration = try Search.Configuration(appID: "", apiKey: "") + let configuration = try SearchClientConfiguration(appID: "", apiKey: "") let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) @@ -174,7 +158,7 @@ final class SearchClientClientTests: XCTestCase { XCTAssertEqual(error.localizedDescription, "`appId` is missing.") } do { - let configuration: Search.Configuration = try Search.Configuration(appID: "", apiKey: "my-api-key") + let configuration = try SearchClientConfiguration(appID: "", apiKey: "my-api-key") let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) @@ -183,7 +167,7 @@ final class SearchClientClientTests: XCTestCase { XCTAssertEqual(error.localizedDescription, "`appId` is missing.") } do { - let configuration: Search.Configuration = try Search.Configuration(appID: "my-app-id", apiKey: "") + let configuration = try SearchClientConfiguration(appID: "my-app-id", apiKey: "") let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) @@ -195,20 +179,14 @@ final class SearchClientClientTests: XCTestCase { /// `addApiKey` throws with invalid parameters func testParametersTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY - ) + let configuration = try SearchClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) } /// `addOrUpdateObject` throws with invalid parameters func testParametersTest2() async throws { - let configuration: Search.Configuration = try Search.Configuration( - appID: self.APPLICATION_ID, - apiKey: self.API_KEY - ) + let configuration = try SearchClientConfiguration(appID: APPLICATION_ID, apiKey: API_KEY) let transporter = Transporter(configuration: configuration, requestBuilder: EchoRequestBuilder()) let client = SearchClient(configuration: configuration, transporter: transporter) diff --git a/tests/output/swift/Tests/requests/AbtestingTests.swift b/tests/output/swift/Tests/requests/AbtestingTests.swift index 34e16f3332e..bedf0e63374 100644 --- a/tests/output/swift/Tests/requests/AbtestingTests.swift +++ b/tests/output/swift/Tests/requests/AbtestingTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import DotEnv import Utils @@ -50,7 +49,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// addABTests with minimal parameters func testAddABTestsTest0() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -96,7 +95,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// allow del method for a custom path with minimal parameters func testCustomDeleteTest0() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -120,7 +119,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// allow del method for a custom path with all parameters func testCustomDeleteTest1() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -153,7 +152,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// allow get method for a custom path with minimal parameters func testCustomGetTest0() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -177,7 +176,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// allow get method for a custom path with all parameters func testCustomGetTest1() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -210,7 +209,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// requestOptions should be escaped too func testCustomGetTest2() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -269,7 +268,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// allow post method for a custom path with minimal parameters func testCustomPostTest0() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -299,7 +298,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// allow post method for a custom path with all parameters func testCustomPostTest1() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -341,7 +340,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// requestOptions can override default query parameters func testCustomPostTest2() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -390,7 +389,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// requestOptions merges query parameters with default ones func testCustomPostTest3() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -442,7 +441,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// requestOptions can override default headers func testCustomPostTest4() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -499,7 +498,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// requestOptions merges headers with default ones func testCustomPostTest5() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -556,7 +555,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts booleans func testCustomPostTest6() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -608,7 +607,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts integers func testCustomPostTest7() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -660,7 +659,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of string func testCustomPostTest8() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -714,7 +713,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of booleans func testCustomPostTest9() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -769,7 +768,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of integers func testCustomPostTest10() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -823,7 +822,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// allow put method for a custom path with minimal parameters func testCustomPutTest0() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -853,7 +852,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// allow put method for a custom path with all parameters func testCustomPutTest1() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -895,7 +894,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// deleteABTest func testDeleteABTestTest0() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -919,7 +918,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// getABTest func testGetABTestTest0() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -943,7 +942,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// listABTests with minimal parameters func testListABTestsTest0() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -965,7 +964,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// listABTests with parameters func testListABTestsTest1() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us @@ -1026,7 +1025,7 @@ final class AbtestingClientRequestsTests: XCTestCase { /// stopABTest func testStopABTestTest0() async throws { - let configuration: Abtesting.Configuration = try Abtesting.Configuration( + let configuration = try AbtestingClientConfiguration( appID: AbtestingClientRequestsTests.APPLICATION_ID, apiKey: AbtestingClientRequestsTests.API_KEY, region: Region.us diff --git a/tests/output/swift/Tests/requests/AnalyticsTests.swift b/tests/output/swift/Tests/requests/AnalyticsTests.swift index 958875f31e5..11b138a8045 100644 --- a/tests/output/swift/Tests/requests/AnalyticsTests.swift +++ b/tests/output/swift/Tests/requests/AnalyticsTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import DotEnv import Utils @@ -50,7 +49,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// allow del method for a custom path with minimal parameters func testCustomDeleteTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -74,7 +73,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// allow del method for a custom path with all parameters func testCustomDeleteTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -107,7 +106,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// allow get method for a custom path with minimal parameters func testCustomGetTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -131,7 +130,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// allow get method for a custom path with all parameters func testCustomGetTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -164,7 +163,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// requestOptions should be escaped too func testCustomGetTest2() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -223,7 +222,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// allow post method for a custom path with minimal parameters func testCustomPostTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -253,7 +252,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// allow post method for a custom path with all parameters func testCustomPostTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -295,7 +294,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// requestOptions can override default query parameters func testCustomPostTest2() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -344,7 +343,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// requestOptions merges query parameters with default ones func testCustomPostTest3() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -396,7 +395,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// requestOptions can override default headers func testCustomPostTest4() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -453,7 +452,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// requestOptions merges headers with default ones func testCustomPostTest5() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -510,7 +509,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts booleans func testCustomPostTest6() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -562,7 +561,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts integers func testCustomPostTest7() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -614,7 +613,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of string func testCustomPostTest8() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -668,7 +667,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of booleans func testCustomPostTest9() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -723,7 +722,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of integers func testCustomPostTest10() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -777,7 +776,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// allow put method for a custom path with minimal parameters func testCustomPutTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -807,7 +806,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// allow put method for a custom path with all parameters func testCustomPutTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -849,7 +848,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getAverageClickPosition with minimal parameters func testGetAverageClickPositionTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -879,7 +878,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getAverageClickPosition with all parameters func testGetAverageClickPositionTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -916,7 +915,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getClickPositions with minimal parameters func testGetClickPositionsTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -946,7 +945,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getClickPositions with all parameters func testGetClickPositionsTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -983,7 +982,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getClickThroughRate with minimal parameters func testGetClickThroughRateTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1013,7 +1012,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getClickThroughRate with all parameters func testGetClickThroughRateTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1050,7 +1049,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getConversationRate with minimal parameters func testGetConversationRateTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1080,7 +1079,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getConversationRate with all parameters func testGetConversationRateTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1117,7 +1116,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getNoClickRate with minimal parameters func testGetNoClickRateTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1147,7 +1146,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getNoClickRate with all parameters func testGetNoClickRateTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1184,7 +1183,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getNoResultsRate with minimal parameters func testGetNoResultsRateTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1214,7 +1213,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getNoResultsRate with all parameters func testGetNoResultsRateTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1251,7 +1250,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getSearchesCount with minimal parameters func testGetSearchesCountTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1281,7 +1280,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getSearchesCount with all parameters func testGetSearchesCountTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1318,7 +1317,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getSearchesNoClicks with minimal parameters func testGetSearchesNoClicksTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1348,7 +1347,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getSearchesNoClicks with all parameters func testGetSearchesNoClicksTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1387,7 +1386,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getSearchesNoResults with minimal parameters func testGetSearchesNoResultsTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1417,7 +1416,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getSearchesNoResults with all parameters func testGetSearchesNoResultsTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1456,7 +1455,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getStatus with minimal parameters func testGetStatusTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1486,7 +1485,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopCountries with minimal parameters func testGetTopCountriesTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1516,7 +1515,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopCountries with all parameters func testGetTopCountriesTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1555,7 +1554,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopFilterAttributes with minimal parameters func testGetTopFilterAttributesTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1585,7 +1584,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopFilterAttributes with all parameters func testGetTopFilterAttributesTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1625,7 +1624,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopFilterForAttribute with minimal parameters func testGetTopFilterForAttributeTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1656,7 +1655,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopFilterForAttribute with minimal parameters and multiple attributes func testGetTopFilterForAttributeTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1687,7 +1686,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopFilterForAttribute with all parameters func testGetTopFilterForAttributeTest2() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1728,7 +1727,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopFilterForAttribute with all parameters and multiple attributes func testGetTopFilterForAttributeTest3() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1769,7 +1768,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopFiltersNoResults with minimal parameters func testGetTopFiltersNoResultsTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1799,7 +1798,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopFiltersNoResults with all parameters func testGetTopFiltersNoResultsTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1839,7 +1838,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopHits with minimal parameters func testGetTopHitsTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1869,7 +1868,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopHits with all parameters func testGetTopHitsTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1910,7 +1909,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopSearches with minimal parameters func testGetTopSearchesTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1940,7 +1939,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getTopSearches with all parameters func testGetTopSearchesTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -1982,7 +1981,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// e2e with complex query params func testGetTopSearchesTest2() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -2032,7 +2031,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getUsersCount with minimal parameters func testGetUsersCountTest0() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us @@ -2062,7 +2061,7 @@ final class AnalyticsClientRequestsTests: XCTestCase { /// get getUsersCount with all parameters func testGetUsersCountTest1() async throws { - let configuration: Analytics.Configuration = try Analytics.Configuration( + let configuration = try AnalyticsClientConfiguration( appID: AnalyticsClientRequestsTests.APPLICATION_ID, apiKey: AnalyticsClientRequestsTests.API_KEY, region: Region.us diff --git a/tests/output/swift/Tests/requests/IngestionTests.swift b/tests/output/swift/Tests/requests/IngestionTests.swift index 1bd2c79bf09..b02983c9afc 100644 --- a/tests/output/swift/Tests/requests/IngestionTests.swift +++ b/tests/output/swift/Tests/requests/IngestionTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import DotEnv import Utils @@ -50,7 +49,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// createAuthenticationOAuth func testCreateAuthenticationTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -92,7 +91,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// createAuthenticationAlgolia func testCreateAuthenticationTest1() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -133,7 +132,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// createDestination func testCreateDestinationTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -174,7 +173,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// createSource func testCreateSourceTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -222,7 +221,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// createTaskOnDemand func testCreateTaskTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -263,7 +262,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// createTaskSchedule func testCreateTaskTest1() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -305,7 +304,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// createTaskSubscription func testCreateTaskTest2() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -346,7 +345,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// allow del method for a custom path with minimal parameters func testCustomDeleteTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -370,7 +369,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// allow del method for a custom path with all parameters func testCustomDeleteTest1() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -403,7 +402,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// allow get method for a custom path with minimal parameters func testCustomGetTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -427,7 +426,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// allow get method for a custom path with all parameters func testCustomGetTest1() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -460,7 +459,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// requestOptions should be escaped too func testCustomGetTest2() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -519,7 +518,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// allow post method for a custom path with minimal parameters func testCustomPostTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -549,7 +548,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// allow post method for a custom path with all parameters func testCustomPostTest1() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -591,7 +590,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// requestOptions can override default query parameters func testCustomPostTest2() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -640,7 +639,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// requestOptions merges query parameters with default ones func testCustomPostTest3() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -692,7 +691,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// requestOptions can override default headers func testCustomPostTest4() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -749,7 +748,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// requestOptions merges headers with default ones func testCustomPostTest5() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -806,7 +805,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts booleans func testCustomPostTest6() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -858,7 +857,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts integers func testCustomPostTest7() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -910,7 +909,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of string func testCustomPostTest8() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -964,7 +963,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of booleans func testCustomPostTest9() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1019,7 +1018,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of integers func testCustomPostTest10() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1073,7 +1072,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// allow put method for a custom path with minimal parameters func testCustomPutTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1103,7 +1102,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// allow put method for a custom path with all parameters func testCustomPutTest1() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1145,7 +1144,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// deleteAuthentication func testDeleteAuthenticationTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1170,7 +1169,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// deleteDestination func testDeleteDestinationTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1195,7 +1194,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// deleteSource func testDeleteSourceTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1219,7 +1218,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// deleteTask func testDeleteTaskTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1243,7 +1242,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// disableTask func testDisableTaskTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1269,7 +1268,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// enable task e2e func testEnableTaskTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1315,7 +1314,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getAuthentication func testGetAuthenticationTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1340,7 +1339,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getAuthentications func testGetAuthenticationsTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1362,7 +1361,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getAuthentications with query params func testGetAuthenticationsTest1() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1437,7 +1436,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getDestination func testGetDestinationTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1461,7 +1460,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getDestinations func testGetDestinationsTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1483,7 +1482,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getDockerSourceStreams func testGetDockerSourceStreamsTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1508,7 +1507,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getEvent func testGetEventTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1536,7 +1535,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getEvents func testGetEventsTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1560,7 +1559,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getRun func testGetRunTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1584,7 +1583,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getRuns func testGetRunsTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1606,7 +1605,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getSource func testGetSourceTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1651,7 +1650,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getSources func testGetSourcesTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1673,7 +1672,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getTask func testGetTaskTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1697,7 +1696,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// getTasks func testGetTasksTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1719,7 +1718,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// runTask func testRunTaskTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1745,7 +1744,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// searchAuthentications func testSearchAuthenticationsTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1783,7 +1782,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// searchDestinations func testSearchDestinationsTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1821,7 +1820,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// searchSources func testSearchSourcesTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1858,7 +1857,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// searchTasks func testSearchTasksTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1923,7 +1922,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// triggerDockerSourceDiscover func testTriggerDockerSourceDiscoverTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1950,7 +1949,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// updateAuthentication func testUpdateAuthenticationTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -1983,7 +1982,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// updateDestination func testUpdateDestinationTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -2016,7 +2015,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// updateSource func testUpdateSourceTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us @@ -2049,7 +2048,7 @@ final class IngestionClientRequestsTests: XCTestCase { /// updateTask func testUpdateTaskTest0() async throws { - let configuration: Ingestion.Configuration = try Ingestion.Configuration( + let configuration = try IngestionClientConfiguration( appID: IngestionClientRequestsTests.APPLICATION_ID, apiKey: IngestionClientRequestsTests.API_KEY, region: Region.us diff --git a/tests/output/swift/Tests/requests/InsightsTests.swift b/tests/output/swift/Tests/requests/InsightsTests.swift index 2409189048a..c890025d841 100644 --- a/tests/output/swift/Tests/requests/InsightsTests.swift +++ b/tests/output/swift/Tests/requests/InsightsTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import DotEnv import Utils @@ -50,7 +49,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// allow del method for a custom path with minimal parameters func testCustomDeleteTest0() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -74,7 +73,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// allow del method for a custom path with all parameters func testCustomDeleteTest1() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -107,7 +106,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// allow get method for a custom path with minimal parameters func testCustomGetTest0() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -131,7 +130,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// allow get method for a custom path with all parameters func testCustomGetTest1() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -164,7 +163,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// requestOptions should be escaped too func testCustomGetTest2() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -223,7 +222,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// allow post method for a custom path with minimal parameters func testCustomPostTest0() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -253,7 +252,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// allow post method for a custom path with all parameters func testCustomPostTest1() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -295,7 +294,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// requestOptions can override default query parameters func testCustomPostTest2() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -344,7 +343,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// requestOptions merges query parameters with default ones func testCustomPostTest3() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -396,7 +395,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// requestOptions can override default headers func testCustomPostTest4() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -453,7 +452,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// requestOptions merges headers with default ones func testCustomPostTest5() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -510,7 +509,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts booleans func testCustomPostTest6() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -562,7 +561,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts integers func testCustomPostTest7() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -614,7 +613,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of string func testCustomPostTest8() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -668,7 +667,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of booleans func testCustomPostTest9() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -723,7 +722,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of integers func testCustomPostTest10() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -777,7 +776,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// allow put method for a custom path with minimal parameters func testCustomPutTest0() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -807,7 +806,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// allow put method for a custom path with all parameters func testCustomPutTest1() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -849,7 +848,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// deleteUserToken0 func testDeleteUserTokenTest0() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -873,7 +872,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// pushEvents0 func testPushEventsTest0() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -929,7 +928,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// Many events type func testPushEventsTest1() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -952,7 +951,7 @@ final class InsightsClientRequestsTests: XCTestCase { queryID: "43b15df305339e827f0ac0bdc5ebcaa7", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_710_201_600_000) + timestamp: Int64(1_710_720_000_000) ) ), EventsItems.viewedObjectIDs( @@ -966,7 +965,7 @@ final class InsightsClientRequestsTests: XCTestCase { ], userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_710_201_600_000) + timestamp: Int64(1_710_720_000_000) ) ), ] @@ -979,7 +978,7 @@ final class InsightsClientRequestsTests: XCTestCase { let echoResponseBodyJSON = try XCTUnwrap(echoResponseBodyData.jsonString) let expectedBodyData = - "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710201600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710201600000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}" + "{\"events\":[{\"eventType\":\"conversion\",\"eventName\":\"Product Purchased\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710720000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"],\"queryID\":\"43b15df305339e827f0ac0bdc5ebcaa7\"},{\"eventType\":\"view\",\"eventName\":\"Product Detail Page Viewed\",\"index\":\"products\",\"userToken\":\"user-123456\",\"authenticatedUserToken\":\"user-123456\",\"timestamp\":1710720000000,\"objectIDs\":[\"9780545139700\",\"9780439784542\"]}]}" .data(using: .utf8) let expectedBodyJSON = try XCTUnwrap(expectedBodyData?.jsonString) @@ -1010,7 +1009,7 @@ final class InsightsClientRequestsTests: XCTestCase { queryID: "43b15df305339e827f0ac0bdc5ebcaa7", userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_710_201_600_000) + timestamp: Int64(1_710_720_000_000) ) ), EventsItems.viewedObjectIDs( @@ -1024,7 +1023,7 @@ final class InsightsClientRequestsTests: XCTestCase { ], userToken: "user-123456", authenticatedUserToken: "user-123456", - timestamp: Int64(1_710_201_600_000) + timestamp: Int64(1_710_720_000_000) ) ), ] @@ -1042,7 +1041,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// ConvertedObjectIDsAfterSearch func testPushEventsTest2() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -1094,7 +1093,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// ViewedObjectIDs func testPushEventsTest3() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us @@ -1142,7 +1141,7 @@ final class InsightsClientRequestsTests: XCTestCase { /// AddedToCartObjectIDs func testPushEventsTest4() async throws { - let configuration: Insights.Configuration = try Insights.Configuration( + let configuration = try InsightsClientConfiguration( appID: InsightsClientRequestsTests.APPLICATION_ID, apiKey: InsightsClientRequestsTests.API_KEY, region: Region.us diff --git a/tests/output/swift/Tests/requests/MonitoringTests.swift b/tests/output/swift/Tests/requests/MonitoringTests.swift index 3aca0a8bb22..6fd35b3994a 100644 --- a/tests/output/swift/Tests/requests/MonitoringTests.swift +++ b/tests/output/swift/Tests/requests/MonitoringTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Core @@ -12,7 +11,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// allow del method for a custom path with minimal parameters func testCustomDeleteTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -35,7 +34,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// allow del method for a custom path with all parameters func testCustomDeleteTest1() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -67,7 +66,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// allow get method for a custom path with minimal parameters func testCustomGetTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -90,7 +89,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// allow get method for a custom path with all parameters func testCustomGetTest1() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -122,7 +121,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// requestOptions should be escaped too func testCustomGetTest2() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -180,7 +179,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// allow post method for a custom path with minimal parameters func testCustomPostTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -209,7 +208,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// allow post method for a custom path with all parameters func testCustomPostTest1() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -250,7 +249,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// requestOptions can override default query parameters func testCustomPostTest2() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -298,7 +297,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// requestOptions merges query parameters with default ones func testCustomPostTest3() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -349,7 +348,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// requestOptions can override default headers func testCustomPostTest4() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -405,7 +404,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// requestOptions merges headers with default ones func testCustomPostTest5() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -461,7 +460,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts booleans func testCustomPostTest6() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -512,7 +511,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts integers func testCustomPostTest7() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -563,7 +562,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of string func testCustomPostTest8() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -616,7 +615,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of booleans func testCustomPostTest9() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -670,7 +669,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of integers func testCustomPostTest10() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -723,7 +722,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// allow put method for a custom path with minimal parameters func testCustomPutTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -752,7 +751,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// allow put method for a custom path with all parameters func testCustomPutTest1() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -793,7 +792,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// getClusterIncidents func testGetClusterIncidentsTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -816,7 +815,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// getClusterStatus func testGetClusterStatusTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -839,7 +838,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// getIncidents func testGetIncidentsTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -860,7 +859,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// getIndexingTime func testGetIndexingTimeTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -883,7 +882,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// getInventory func testGetInventoryTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -904,7 +903,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// getLatency func testGetLatencyTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -927,7 +926,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// getMetrics func testGetMetricsTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -951,7 +950,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// getReachability func testGetReachabilityTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) @@ -974,7 +973,7 @@ final class MonitoringClientRequestsTests: XCTestCase { /// getStatus func testGetStatusTest0() async throws { - let configuration: Monitoring.Configuration = try Monitoring.Configuration( + let configuration = try MonitoringClientConfiguration( appID: MonitoringClientRequestsTests.APPLICATION_ID, apiKey: MonitoringClientRequestsTests.API_KEY ) diff --git a/tests/output/swift/Tests/requests/PersonalizationTests.swift b/tests/output/swift/Tests/requests/PersonalizationTests.swift index e973d2a1e81..a9673c0c64c 100644 --- a/tests/output/swift/Tests/requests/PersonalizationTests.swift +++ b/tests/output/swift/Tests/requests/PersonalizationTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Core @@ -12,7 +11,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// allow del method for a custom path with minimal parameters func testCustomDeleteTest0() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -36,7 +35,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// allow del method for a custom path with all parameters func testCustomDeleteTest1() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -69,7 +68,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// allow get method for a custom path with minimal parameters func testCustomGetTest0() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -93,7 +92,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// allow get method for a custom path with all parameters func testCustomGetTest1() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -126,7 +125,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// requestOptions should be escaped too func testCustomGetTest2() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -185,7 +184,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// allow post method for a custom path with minimal parameters func testCustomPostTest0() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -215,7 +214,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// allow post method for a custom path with all parameters func testCustomPostTest1() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -257,7 +256,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// requestOptions can override default query parameters func testCustomPostTest2() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -306,7 +305,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// requestOptions merges query parameters with default ones func testCustomPostTest3() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -358,7 +357,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// requestOptions can override default headers func testCustomPostTest4() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -415,7 +414,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// requestOptions merges headers with default ones func testCustomPostTest5() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -472,7 +471,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts booleans func testCustomPostTest6() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -524,7 +523,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts integers func testCustomPostTest7() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -576,7 +575,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of string func testCustomPostTest8() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -630,7 +629,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of booleans func testCustomPostTest9() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -685,7 +684,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of integers func testCustomPostTest10() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -739,7 +738,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// allow put method for a custom path with minimal parameters func testCustomPutTest0() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -769,7 +768,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// allow put method for a custom path with all parameters func testCustomPutTest1() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -811,7 +810,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// delete deleteUserProfile func testDeleteUserProfileTest0() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -835,7 +834,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// get getPersonalizationStrategy func testGetPersonalizationStrategyTest0() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -857,7 +856,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// get getUserTokenProfile func testGetUserTokenProfileTest0() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us @@ -881,7 +880,7 @@ final class PersonalizationClientRequestsTests: XCTestCase { /// set setPersonalizationStrategy func testSetPersonalizationStrategyTest0() async throws { - let configuration: Personalization.Configuration = try Personalization.Configuration( + let configuration = try PersonalizationClientConfiguration( appID: PersonalizationClientRequestsTests.APPLICATION_ID, apiKey: PersonalizationClientRequestsTests.API_KEY, region: Region.us diff --git a/tests/output/swift/Tests/requests/QuerySuggestionsTests.swift b/tests/output/swift/Tests/requests/QuerySuggestionsTests.swift index e0b8b37123d..ed15f38ee03 100644 --- a/tests/output/swift/Tests/requests/QuerySuggestionsTests.swift +++ b/tests/output/swift/Tests/requests/QuerySuggestionsTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import DotEnv import Utils @@ -50,7 +49,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// createConfig0 func testCreateConfigTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -81,7 +80,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { ] ), ], - languages: Languages.arrayOfString( + languages: QuerySuggestionsLanguages.arrayOfString( [ "french", ] @@ -112,7 +111,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// allow del method for a custom path with minimal parameters func testCustomDeleteTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -136,7 +135,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// allow del method for a custom path with all parameters func testCustomDeleteTest1() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -169,7 +168,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// allow get method for a custom path with minimal parameters func testCustomGetTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -193,7 +192,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// allow get method for a custom path with all parameters func testCustomGetTest1() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -226,7 +225,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// requestOptions should be escaped too func testCustomGetTest2() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -285,7 +284,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// allow post method for a custom path with minimal parameters func testCustomPostTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -315,7 +314,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// allow post method for a custom path with all parameters func testCustomPostTest1() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -357,7 +356,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// requestOptions can override default query parameters func testCustomPostTest2() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -406,7 +405,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// requestOptions merges query parameters with default ones func testCustomPostTest3() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -458,7 +457,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// requestOptions can override default headers func testCustomPostTest4() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -515,7 +514,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// requestOptions merges headers with default ones func testCustomPostTest5() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -572,7 +571,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts booleans func testCustomPostTest6() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -624,7 +623,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts integers func testCustomPostTest7() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -676,7 +675,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of string func testCustomPostTest8() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -730,7 +729,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of booleans func testCustomPostTest9() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -785,7 +784,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of integers func testCustomPostTest10() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -839,7 +838,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// allow put method for a custom path with minimal parameters func testCustomPutTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -869,7 +868,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// allow put method for a custom path with all parameters func testCustomPutTest1() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -911,7 +910,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// deleteConfig0 func testDeleteConfigTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -935,7 +934,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// getAllConfigs0 func testGetAllConfigsTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -957,7 +956,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// Retrieve QS config e2e func testGetConfigTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -1002,7 +1001,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// getConfigStatus0 func testGetConfigStatusTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -1026,7 +1025,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// getLogFile0 func testGetLogFileTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -1050,7 +1049,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { /// updateConfig0 func testUpdateConfigTest0() async throws { - let configuration: QuerySuggestions.Configuration = try QuerySuggestions.Configuration( + let configuration = try QuerySuggestionsClientConfiguration( appID: QuerySuggestionsClientRequestsTests.APPLICATION_ID, apiKey: QuerySuggestionsClientRequestsTests.API_KEY, region: Region.us @@ -1060,7 +1059,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { let response = try await client.updateConfigWithHTTPInfo( indexName: "theIndexName", - querySuggestionsConfiguration: QuerySuggestionsConfiguration( + configuration: QuerySuggestionsConfiguration( sourceIndices: [ SourceIndex( indexName: "testIndex", @@ -1080,7 +1079,7 @@ final class QuerySuggestionsClientRequestsTests: XCTestCase { ] ), ], - languages: Languages.arrayOfString( + languages: QuerySuggestionsLanguages.arrayOfString( [ "french", ] diff --git a/tests/output/swift/Tests/requests/RecommendTests.swift b/tests/output/swift/Tests/requests/RecommendTests.swift index f56d36fb379..c073f45f5d3 100644 --- a/tests/output/swift/Tests/requests/RecommendTests.swift +++ b/tests/output/swift/Tests/requests/RecommendTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import Utils @testable import Core @@ -12,7 +11,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// allow del method for a custom path with minimal parameters func testCustomDeleteTest0() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -35,7 +34,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// allow del method for a custom path with all parameters func testCustomDeleteTest1() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -67,7 +66,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// allow get method for a custom path with minimal parameters func testCustomGetTest0() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -90,7 +89,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// allow get method for a custom path with all parameters func testCustomGetTest1() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -122,7 +121,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// requestOptions should be escaped too func testCustomGetTest2() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -180,7 +179,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// allow post method for a custom path with minimal parameters func testCustomPostTest0() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -209,7 +208,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// allow post method for a custom path with all parameters func testCustomPostTest1() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -250,7 +249,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// requestOptions can override default query parameters func testCustomPostTest2() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -298,7 +297,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// requestOptions merges query parameters with default ones func testCustomPostTest3() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -349,7 +348,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// requestOptions can override default headers func testCustomPostTest4() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -405,7 +404,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// requestOptions merges headers with default ones func testCustomPostTest5() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -461,7 +460,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts booleans func testCustomPostTest6() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -512,7 +511,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts integers func testCustomPostTest7() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -563,7 +562,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of string func testCustomPostTest8() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -616,7 +615,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of booleans func testCustomPostTest9() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -670,7 +669,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of integers func testCustomPostTest10() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -723,7 +722,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// allow put method for a custom path with minimal parameters func testCustomPutTest0() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -752,7 +751,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// allow put method for a custom path with all parameters func testCustomPutTest1() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -793,7 +792,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// deleteRecommendRule0 func testDeleteRecommendRuleTest0() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -818,7 +817,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// getRecommendRule0 func testGetRecommendRuleTest0() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -843,7 +842,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// getRecommendStatus0 func testGetRecommendStatusTest0() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -868,7 +867,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// get recommendations for recommend model with minimal parameters func testGetRecommendationsTest0() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -912,7 +911,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// get recommendations for recommend model with all parameters func testGetRecommendationsTest1() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -931,18 +930,18 @@ final class RecommendClientRequestsTests: XCTestCase { maxRecommendations: 10, model: RecommendationModels.relatedProducts, objectID: "objectID", - queryParameters: SearchParamsObject( + queryParameters: RecommendSearchParamsObject( query: "myQuery", - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + facetFilters: RecommendFacetFilters.arrayOfRecommendMixedSearchFilters( + [RecommendMixedSearchFilters.string( "query" )] ) ), - fallbackParameters: SearchParamsObject( + fallbackParameters: RecommendSearchParamsObject( query: "myQuery", - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + facetFilters: RecommendFacetFilters.arrayOfRecommendMixedSearchFilters( + [RecommendMixedSearchFilters.string( "fallback" )] ) @@ -973,7 +972,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// get recommendations for trending model with minimal parameters func testGetRecommendationsTest2() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -1016,7 +1015,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// get recommendations for trending model with all parameters func testGetRecommendationsTest3() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -1036,18 +1035,18 @@ final class RecommendClientRequestsTests: XCTestCase { facetName: "myFacetName", facetValue: "myFacetValue", model: TrendingItemsModel.trendingItems, - queryParameters: SearchParamsObject( + queryParameters: RecommendSearchParamsObject( query: "myQuery", - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + facetFilters: RecommendFacetFilters.arrayOfRecommendMixedSearchFilters( + [RecommendMixedSearchFilters.string( "query" )] ) ), - fallbackParameters: SearchParamsObject( + fallbackParameters: RecommendSearchParamsObject( query: "myQuery", - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + facetFilters: RecommendFacetFilters.arrayOfRecommendMixedSearchFilters( + [RecommendMixedSearchFilters.string( "fallback" )] ) @@ -1078,7 +1077,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// get multiple recommendations with minimal parameters func testGetRecommendationsTest4() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -1129,7 +1128,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// get multiple recommendations with all parameters func testGetRecommendationsTest5() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -1147,18 +1146,18 @@ final class RecommendClientRequestsTests: XCTestCase { maxRecommendations: 10, model: RecommendationModels.relatedProducts, objectID: "objectID1", - queryParameters: SearchParamsObject( + queryParameters: RecommendSearchParamsObject( query: "myQuery", - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + facetFilters: RecommendFacetFilters.arrayOfRecommendMixedSearchFilters( + [RecommendMixedSearchFilters.string( "query1" )] ) ), - fallbackParameters: SearchParamsObject( + fallbackParameters: RecommendSearchParamsObject( query: "myQuery", - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + facetFilters: RecommendFacetFilters.arrayOfRecommendMixedSearchFilters( + [RecommendMixedSearchFilters.string( "fallback1" )] ) @@ -1172,18 +1171,18 @@ final class RecommendClientRequestsTests: XCTestCase { maxRecommendations: 10, model: RecommendationModels.relatedProducts, objectID: "objectID2", - queryParameters: SearchParamsObject( + queryParameters: RecommendSearchParamsObject( query: "myQuery", - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + facetFilters: RecommendFacetFilters.arrayOfRecommendMixedSearchFilters( + [RecommendMixedSearchFilters.string( "query2" )] ) ), - fallbackParameters: SearchParamsObject( + fallbackParameters: RecommendSearchParamsObject( query: "myQuery", - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + facetFilters: RecommendFacetFilters.arrayOfRecommendMixedSearchFilters( + [RecommendMixedSearchFilters.string( "fallback2" )] ) @@ -1214,7 +1213,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// get frequently bought together recommendations func testGetRecommendationsTest6() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) @@ -1258,7 +1257,7 @@ final class RecommendClientRequestsTests: XCTestCase { /// searchRecommendRules0 func testSearchRecommendRulesTest0() async throws { - let configuration: Recommend.Configuration = try Recommend.Configuration( + let configuration = try RecommendClientConfiguration( appID: RecommendClientRequestsTests.APPLICATION_ID, apiKey: RecommendClientRequestsTests.API_KEY ) diff --git a/tests/output/swift/Tests/requests/SearchTests.swift b/tests/output/swift/Tests/requests/SearchTests.swift index e02aac90008..f4c6f94b55b 100644 --- a/tests/output/swift/Tests/requests/SearchTests.swift +++ b/tests/output/swift/Tests/requests/SearchTests.swift @@ -1,6 +1,5 @@ import XCTest -import AnyCodable import DotEnv import Utils @@ -50,7 +49,7 @@ final class SearchClientRequestsTests: XCTestCase { /// addApiKey0 func testAddApiKeyTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -90,7 +89,7 @@ final class SearchClientRequestsTests: XCTestCase { /// addOrUpdateObject0 func testAddOrUpdateObjectTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -123,7 +122,7 @@ final class SearchClientRequestsTests: XCTestCase { /// appendSource0 func testAppendSourceTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -131,7 +130,7 @@ final class SearchClientRequestsTests: XCTestCase { let client = SearchClient(configuration: configuration, transporter: transporter) let response = try await client.appendSourceWithHTTPInfo( - source: Source( + source: SearchSource( source: "theSource", description: "theDescription" ) @@ -155,7 +154,7 @@ final class SearchClientRequestsTests: XCTestCase { /// assignUserId0 func testAssignUserIdTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -195,7 +194,7 @@ final class SearchClientRequestsTests: XCTestCase { /// it should not encode the userID func testAssignUserIdTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -235,7 +234,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allows batch method with `addObject` action func testBatchTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -275,7 +274,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allows batch method with `clear` action func testBatchTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -315,7 +314,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allows batch method with `delete` action func testBatchTest2() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -355,7 +354,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allows batch method with `deleteObject` action func testBatchTest3() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -395,7 +394,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allows batch method with `partialUpdateObject` action func testBatchTest4() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -435,7 +434,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allows batch method with `partialUpdateObjectNoCreate` action func testBatchTest5() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -476,7 +475,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allows batch method with `updateObject` action func testBatchTest6() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -516,7 +515,7 @@ final class SearchClientRequestsTests: XCTestCase { /// batchAssignUserIds0 func testBatchAssignUserIdsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -560,7 +559,7 @@ final class SearchClientRequestsTests: XCTestCase { /// get batchDictionaryEntries results with minimal parameters func testBatchDictionaryEntriesTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -609,7 +608,7 @@ final class SearchClientRequestsTests: XCTestCase { /// get batchDictionaryEntries results with all parameters func testBatchDictionaryEntriesTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -679,7 +678,7 @@ final class SearchClientRequestsTests: XCTestCase { /// get batchDictionaryEntries results additional properties func testBatchDictionaryEntriesTest2() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -722,7 +721,7 @@ final class SearchClientRequestsTests: XCTestCase { /// browse with minimal parameters func testBrowseTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -772,7 +771,7 @@ final class SearchClientRequestsTests: XCTestCase { /// browse with search parameters func testBrowseTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -784,8 +783,8 @@ final class SearchClientRequestsTests: XCTestCase { browseParams: BrowseParams.browseParamsObject( BrowseParamsObject( query: "myQuery", - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + facetFilters: SearchFacetFilters.arrayOfSearchMixedSearchFilters( + [SearchMixedSearchFilters.string( "tags:algolia" )] ) @@ -811,7 +810,7 @@ final class SearchClientRequestsTests: XCTestCase { /// browse allow a cursor in parameters func testBrowseTest2() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -845,7 +844,7 @@ final class SearchClientRequestsTests: XCTestCase { /// clearObjects0 func testClearObjectsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -870,7 +869,7 @@ final class SearchClientRequestsTests: XCTestCase { /// clearRules0 func testClearRulesTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -895,7 +894,7 @@ final class SearchClientRequestsTests: XCTestCase { /// clearSynonyms0 func testClearSynonymsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -920,7 +919,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allow del method for a custom path with minimal parameters func testCustomDeleteTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -943,7 +942,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allow del method for a custom path with all parameters func testCustomDeleteTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -975,7 +974,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allow get method for a custom path with minimal parameters func testCustomGetTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -998,7 +997,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allow get method for a custom path with all parameters func testCustomGetTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1030,7 +1029,7 @@ final class SearchClientRequestsTests: XCTestCase { /// requestOptions should be escaped too func testCustomGetTest2() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1088,7 +1087,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allow post method for a custom path with minimal parameters func testCustomPostTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1117,7 +1116,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allow post method for a custom path with all parameters func testCustomPostTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1158,7 +1157,7 @@ final class SearchClientRequestsTests: XCTestCase { /// requestOptions can override default query parameters func testCustomPostTest2() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1206,7 +1205,7 @@ final class SearchClientRequestsTests: XCTestCase { /// requestOptions merges query parameters with default ones func testCustomPostTest3() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1257,7 +1256,7 @@ final class SearchClientRequestsTests: XCTestCase { /// requestOptions can override default headers func testCustomPostTest4() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1313,7 +1312,7 @@ final class SearchClientRequestsTests: XCTestCase { /// requestOptions merges headers with default ones func testCustomPostTest5() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1369,7 +1368,7 @@ final class SearchClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts booleans func testCustomPostTest6() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1420,7 +1419,7 @@ final class SearchClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts integers func testCustomPostTest7() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1471,7 +1470,7 @@ final class SearchClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of string func testCustomPostTest8() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1524,7 +1523,7 @@ final class SearchClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of booleans func testCustomPostTest9() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1578,7 +1577,7 @@ final class SearchClientRequestsTests: XCTestCase { /// requestOptions queryParameters accepts list of integers func testCustomPostTest10() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1631,7 +1630,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allow put method for a custom path with minimal parameters func testCustomPutTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1660,7 +1659,7 @@ final class SearchClientRequestsTests: XCTestCase { /// allow put method for a custom path with all parameters func testCustomPutTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1701,7 +1700,7 @@ final class SearchClientRequestsTests: XCTestCase { /// deleteApiKey0 func testDeleteApiKeyTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1724,7 +1723,7 @@ final class SearchClientRequestsTests: XCTestCase { /// deleteBy0 func testDeleteByTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1756,7 +1755,7 @@ final class SearchClientRequestsTests: XCTestCase { /// deleteIndex0 func testDeleteIndexTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1779,7 +1778,7 @@ final class SearchClientRequestsTests: XCTestCase { /// deleteObject0 func testDeleteObjectTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1803,7 +1802,7 @@ final class SearchClientRequestsTests: XCTestCase { /// delete rule simple case func testDeleteRuleTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1827,7 +1826,7 @@ final class SearchClientRequestsTests: XCTestCase { /// delete rule with simple characters to encode in objectID func testDeleteRuleTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1851,7 +1850,7 @@ final class SearchClientRequestsTests: XCTestCase { /// deleteSource0 func testDeleteSourceTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1874,7 +1873,7 @@ final class SearchClientRequestsTests: XCTestCase { /// deleteSynonym0 func testDeleteSynonymTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1898,7 +1897,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getApiKey0 func testGetApiKeyTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1921,7 +1920,7 @@ final class SearchClientRequestsTests: XCTestCase { /// get getDictionaryLanguages func testGetDictionaryLanguagesTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1942,7 +1941,7 @@ final class SearchClientRequestsTests: XCTestCase { /// get getDictionarySettings results func testGetDictionarySettingsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1963,7 +1962,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getLogs with minimal parameters func testGetLogsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -1984,7 +1983,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getLogs with parameters func testGetLogsTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2020,7 +2019,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getObject0 func testGetObjectTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2057,7 +2056,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getObjects0 func testGetObjectsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2099,7 +2098,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getRule0 func testGetRuleTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2123,7 +2122,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getSettings0 func testGetSettingsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2167,7 +2166,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getSources0 func testGetSourcesTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2188,7 +2187,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getSynonym0 func testGetSynonymTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2212,7 +2211,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getTask0 func testGetTaskTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2236,7 +2235,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getTopUserIds0 func testGetTopUserIdsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2257,7 +2256,7 @@ final class SearchClientRequestsTests: XCTestCase { /// getUserId0 func testGetUserIdTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2280,7 +2279,7 @@ final class SearchClientRequestsTests: XCTestCase { /// hasPendingMappings with minimal parameters func testHasPendingMappingsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2301,7 +2300,7 @@ final class SearchClientRequestsTests: XCTestCase { /// hasPendingMappings with parameters func testHasPendingMappingsTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2330,7 +2329,7 @@ final class SearchClientRequestsTests: XCTestCase { /// listApiKeys0 func testListApiKeysTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2351,7 +2350,7 @@ final class SearchClientRequestsTests: XCTestCase { /// listClusters0 func testListClustersTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2372,7 +2371,7 @@ final class SearchClientRequestsTests: XCTestCase { /// listIndices with minimal parameters func testListIndicesTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2393,7 +2392,7 @@ final class SearchClientRequestsTests: XCTestCase { /// listIndices with parameters func testListIndicesTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2423,7 +2422,7 @@ final class SearchClientRequestsTests: XCTestCase { /// listUserIds with minimal parameters func testListUserIdsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2444,7 +2443,7 @@ final class SearchClientRequestsTests: XCTestCase { /// listUserIds with parameters func testListUserIdsTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2474,7 +2473,7 @@ final class SearchClientRequestsTests: XCTestCase { /// multipleBatch0 func testMultipleBatchTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2515,7 +2514,7 @@ final class SearchClientRequestsTests: XCTestCase { /// operationIndex0 func testOperationIndexTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2553,7 +2552,7 @@ final class SearchClientRequestsTests: XCTestCase { /// partialUpdateObject0 func testPartialUpdateObjectTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2596,7 +2595,7 @@ final class SearchClientRequestsTests: XCTestCase { /// removeUserId0 func testRemoveUserIdTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2619,7 +2618,7 @@ final class SearchClientRequestsTests: XCTestCase { /// replaceSources0 func testReplaceSourcesTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2628,7 +2627,7 @@ final class SearchClientRequestsTests: XCTestCase { let response = try await client.replaceSourcesWithHTTPInfo( source: [ - Source( + SearchSource( source: "theSource", description: "theDescription" ), @@ -2653,7 +2652,7 @@ final class SearchClientRequestsTests: XCTestCase { /// restoreApiKey0 func testRestoreApiKeyTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2678,7 +2677,7 @@ final class SearchClientRequestsTests: XCTestCase { /// saveObject0 func testSaveObjectTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2711,7 +2710,7 @@ final class SearchClientRequestsTests: XCTestCase { /// saveRule with minimal parameters func testSaveRuleTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2724,9 +2723,9 @@ final class SearchClientRequestsTests: XCTestCase { rule: Rule( objectID: "id1", conditions: [ - Condition( + SearchCondition( pattern: "apple", - anchoring: Anchoring.contains + anchoring: SearchAnchoring.contains ), ] ) @@ -2752,7 +2751,7 @@ final class SearchClientRequestsTests: XCTestCase { /// saveRule with all parameters func testSaveRuleTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2765,29 +2764,29 @@ final class SearchClientRequestsTests: XCTestCase { rule: Rule( objectID: "id1", conditions: [ - Condition( + SearchCondition( pattern: "apple", - anchoring: Anchoring.contains, + anchoring: SearchAnchoring.contains, alternatives: false, context: "search" ), ], - consequence: Consequence( - params: ConsequenceParams( + consequence: SearchConsequence( + params: SearchConsequenceParams( filters: "brand:apple", - query: ConsequenceQuery.consequenceQueryObject( - ConsequenceQueryObject( + query: SearchConsequenceQuery.searchConsequenceQueryObject( + SearchConsequenceQueryObject( remove: [ "algolia", ], edits: [ - Edit( - type: EditType.remove, + SearchEdit( + type: SearchEditType.remove, delete: "abc", insert: "cde" ), - Edit( - type: EditType.replace, + SearchEdit( + type: SearchEditType.replace, delete: "abc", insert: "cde" ), @@ -2795,13 +2794,13 @@ final class SearchClientRequestsTests: XCTestCase { ) ) ), - promote: [Promote.promoteObjectID( - PromoteObjectID( + promote: [SearchPromote.searchPromoteObjectID( + SearchPromoteObjectID( objectID: "abc", position: 3 ) - ), Promote.promoteObjectIDs( - PromoteObjectIDs( + ), SearchPromote.searchPromoteObjectIDs( + SearchPromoteObjectIDs( objectIDs: [ "abc", "def", @@ -2811,7 +2810,7 @@ final class SearchClientRequestsTests: XCTestCase { )], filterPromotes: false, hide: [ - ConsequenceHide( + SearchConsequenceHide( objectID: "321" ), ], @@ -2855,7 +2854,7 @@ final class SearchClientRequestsTests: XCTestCase { /// saveRules with minimal parameters func testSaveRulesTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2868,18 +2867,18 @@ final class SearchClientRequestsTests: XCTestCase { Rule( objectID: "a-rule-id", conditions: [ - Condition( + SearchCondition( pattern: "smartphone", - anchoring: Anchoring.contains + anchoring: SearchAnchoring.contains ), ] ), Rule( objectID: "a-second-rule-id", conditions: [ - Condition( + SearchCondition( pattern: "apple", - anchoring: Anchoring.contains + anchoring: SearchAnchoring.contains ), ] ), @@ -2906,7 +2905,7 @@ final class SearchClientRequestsTests: XCTestCase { /// saveRules with all parameters func testSaveRulesTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -2919,29 +2918,29 @@ final class SearchClientRequestsTests: XCTestCase { Rule( objectID: "id1", conditions: [ - Condition( + SearchCondition( pattern: "apple", - anchoring: Anchoring.contains, + anchoring: SearchAnchoring.contains, alternatives: false, context: "search" ), ], - consequence: Consequence( - params: ConsequenceParams( + consequence: SearchConsequence( + params: SearchConsequenceParams( filters: "brand:apple", - query: ConsequenceQuery.consequenceQueryObject( - ConsequenceQueryObject( + query: SearchConsequenceQuery.searchConsequenceQueryObject( + SearchConsequenceQueryObject( remove: [ "algolia", ], edits: [ - Edit( - type: EditType.remove, + SearchEdit( + type: SearchEditType.remove, delete: "abc", insert: "cde" ), - Edit( - type: EditType.replace, + SearchEdit( + type: SearchEditType.replace, delete: "abc", insert: "cde" ), @@ -2949,13 +2948,13 @@ final class SearchClientRequestsTests: XCTestCase { ) ) ), - promote: [Promote.promoteObjectID( - PromoteObjectID( + promote: [SearchPromote.searchPromoteObjectID( + SearchPromoteObjectID( objectID: "abc", position: 3 ) - ), Promote.promoteObjectIDs( - PromoteObjectIDs( + ), SearchPromote.searchPromoteObjectIDs( + SearchPromoteObjectIDs( objectIDs: [ "abc", "def", @@ -2965,7 +2964,7 @@ final class SearchClientRequestsTests: XCTestCase { )], filterPromotes: false, hide: [ - ConsequenceHide( + SearchConsequenceHide( objectID: "321" ), ], @@ -3012,7 +3011,7 @@ final class SearchClientRequestsTests: XCTestCase { /// saveSynonym0 func testSaveSynonymTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3060,7 +3059,7 @@ final class SearchClientRequestsTests: XCTestCase { /// saveSynonyms0 func testSaveSynonymsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3124,7 +3123,7 @@ final class SearchClientRequestsTests: XCTestCase { /// search for a single hits request with minimal parameters func testSearchTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3194,7 +3193,7 @@ final class SearchClientRequestsTests: XCTestCase { /// search for a single facet request with minimal parameters func testSearchTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3264,7 +3263,7 @@ final class SearchClientRequestsTests: XCTestCase { /// search for a single hits request with all parameters func testSearchTest2() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3308,7 +3307,7 @@ final class SearchClientRequestsTests: XCTestCase { /// search for a single facet request with all parameters func testSearchTest3() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3351,7 +3350,7 @@ final class SearchClientRequestsTests: XCTestCase { /// search for multiple mixed requests in multiple indices with minimal parameters func testSearchTest4() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3400,7 +3399,7 @@ final class SearchClientRequestsTests: XCTestCase { /// search for multiple mixed requests in multiple indices with all parameters func testSearchTest5() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3450,7 +3449,7 @@ final class SearchClientRequestsTests: XCTestCase { /// search filters accept all of the possible shapes func testSearchTest6() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3462,19 +3461,19 @@ final class SearchClientRequestsTests: XCTestCase { requests: [ SearchQuery.searchForHits( SearchForHits( - facetFilters: FacetFilters.string( + facetFilters: SearchFacetFilters.string( "mySearch:filters" ), - optionalFilters: OptionalFilters.string( + optionalFilters: SearchOptionalFilters.string( "mySearch:filters" ), - numericFilters: NumericFilters.string( + numericFilters: SearchNumericFilters.string( "mySearch:filters" ), - tagFilters: TagFilters.string( + tagFilters: SearchTagFilters.string( "mySearch:filters" ), - reRankingApplyFilter: ReRankingApplyFilter.string( + reRankingApplyFilter: SearchReRankingApplyFilter.string( "mySearch:filters" ), indexName: "theIndexName" @@ -3482,48 +3481,60 @@ final class SearchClientRequestsTests: XCTestCase { ), SearchQuery.searchForHits( SearchForHits( - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( - "mySearch:filters" - ), MixedSearchFilters.arrayOfString( - [ - "mySearch:filters", - ] - )] + facetFilters: SearchFacetFilters.arrayOfSearchMixedSearchFilters( + [ + SearchMixedSearchFilters.string( + "mySearch:filters" + ), + SearchMixedSearchFilters.arrayOfString( + [ + "mySearch:filters", + ] + ), + ] ), - optionalFilters: OptionalFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( - "mySearch:filters" - ), MixedSearchFilters.arrayOfString( - [ - "mySearch:filters", - ] - )] + optionalFilters: SearchOptionalFilters.arrayOfSearchMixedSearchFilters( + [ + SearchMixedSearchFilters.string( + "mySearch:filters" + ), + SearchMixedSearchFilters.arrayOfString( + [ + "mySearch:filters", + ] + ), + ] ), - numericFilters: NumericFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( - "mySearch:filters" - ), MixedSearchFilters.arrayOfString( - [ - "mySearch:filters", - ] - )] + numericFilters: SearchNumericFilters.arrayOfSearchMixedSearchFilters( + [ + SearchMixedSearchFilters.string( + "mySearch:filters" + ), + SearchMixedSearchFilters.arrayOfString( + [ + "mySearch:filters", + ] + ), + ] ), - tagFilters: TagFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( - "mySearch:filters" - ), MixedSearchFilters.arrayOfString( - [ - "mySearch:filters", - ] - )] + tagFilters: SearchTagFilters.arrayOfSearchMixedSearchFilters( + [ + SearchMixedSearchFilters.string( + "mySearch:filters" + ), + SearchMixedSearchFilters.arrayOfString( + [ + "mySearch:filters", + ] + ), + ] ), - reRankingApplyFilter: ReRankingApplyFilter.arrayOfMixedSearchFilters( + reRankingApplyFilter: SearchReRankingApplyFilter.arrayOfSearchMixedSearchFilters( [ - MixedSearchFilters.string( + SearchMixedSearchFilters.string( "mySearch:filters" ), - MixedSearchFilters.arrayOfString( + SearchMixedSearchFilters.arrayOfString( [ "mySearch:filters", ] @@ -3557,7 +3568,7 @@ final class SearchClientRequestsTests: XCTestCase { /// search with all search parameters func testSearchTest7() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3574,23 +3585,23 @@ final class SearchClientRequestsTests: XCTestCase { query: "", similarQuery: "", filters: "", - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + facetFilters: SearchFacetFilters.arrayOfSearchMixedSearchFilters( + [SearchMixedSearchFilters.string( "" )] ), - optionalFilters: OptionalFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + optionalFilters: SearchOptionalFilters.arrayOfSearchMixedSearchFilters( + [SearchMixedSearchFilters.string( "" )] ), - numericFilters: NumericFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + numericFilters: SearchNumericFilters.arrayOfSearchMixedSearchFilters( + [SearchMixedSearchFilters.string( "" )] ), - tagFilters: TagFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + tagFilters: SearchTagFilters.arrayOfSearchMixedSearchFilters( + [SearchMixedSearchFilters.string( "" )] ), @@ -3607,10 +3618,10 @@ final class SearchClientRequestsTests: XCTestCase { length: 1, aroundLatLng: "", aroundLatLngViaIP: true, - aroundRadius: AroundRadius.aroundRadiusAll( - AroundRadiusAll.all + aroundRadius: SearchAroundRadius.searchAroundRadiusAll( + SearchAroundRadiusAll.all ), - aroundPrecision: AroundPrecision.int( + aroundPrecision: SearchAroundPrecision.int( 0 ), minimumAroundRadius: 1, @@ -3686,17 +3697,17 @@ final class SearchClientRequestsTests: XCTestCase { hitsPerPage: 1, minWordSizefor1Typo: 0, minWordSizefor2Typos: 0, - typoTolerance: TypoTolerance.typoToleranceEnum( - TypoToleranceEnum.min + typoTolerance: SearchTypoTolerance.searchTypoToleranceEnum( + SearchTypoToleranceEnum.min ), allowTyposOnNumericTokens: true, disableTypoToleranceOnAttributes: [ "", ], - ignorePlurals: IgnorePlurals.bool( + ignorePlurals: SearchIgnorePlurals.bool( false ), - removeStopWords: RemoveStopWords.bool( + removeStopWords: SearchRemoveStopWords.bool( true ), keepDiacriticsOnCharacters: "", @@ -3706,8 +3717,8 @@ final class SearchClientRequestsTests: XCTestCase { decompoundQuery: true, enableRules: true, enablePersonalization: true, - queryType: QueryType.prefixAll, - removeWordsIfNoResults: RemoveWordsIfNoResults.allOptional, + queryType: SearchQueryType.prefixAll, + removeWordsIfNoResults: SearchRemoveWordsIfNoResults.allOptional, advancedSyntax: true, optionalWords: [ "", @@ -3715,14 +3726,14 @@ final class SearchClientRequestsTests: XCTestCase { disableExactOnAttributes: [ "", ], - exactOnSingleWordQuery: ExactOnSingleWordQuery.attribute, + exactOnSingleWordQuery: SearchExactOnSingleWordQuery.attribute, alternativesAsExact: [ - AlternativesAsExact.multiWordsSynonym, + SearchAlternativesAsExact.multiWordsSynonym, ], advancedSyntaxFeatures: [ - AdvancedSyntaxFeatures.exactPhrase, + SearchAdvancedSyntaxFeatures.exactPhrase, ], - distinct: Distinct.int( + distinct: SearchDistinct.int( 0 ), replaceSynonymsInHighlight: true, @@ -3733,28 +3744,29 @@ final class SearchClientRequestsTests: XCTestCase { maxValuesPerFacet: 0, sortFacetValuesBy: "", attributeCriteriaComputedByMinProximity: true, - renderingContent: RenderingContent( - facetOrdering: FacetOrdering( - facets: Facets( + renderingContent: SearchRenderingContent( + facetOrdering: SearchFacetOrdering( + facets: SearchFacets( order: [ "a", "b", ] ), values: [ - "a": Value(order: ["b", - ], - sortRemainingBy: SortRemainingBy.count + "a": SearchValue(order: ["b", + ], + sortRemainingBy: SearchSortRemainingBy.count ), ] ) ), enableReRanking: true, - reRankingApplyFilter: ReRankingApplyFilter.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( - "" - )] - ), + reRankingApplyFilter: SearchReRankingApplyFilter + .arrayOfSearchMixedSearchFilters( + [SearchMixedSearchFilters.string( + "" + )] + ), indexName: "theIndexName", type: SearchTypeDefault.`default` ) @@ -3783,7 +3795,7 @@ final class SearchClientRequestsTests: XCTestCase { /// get searchDictionaryEntries results with minimal parameters func testSearchDictionaryEntriesTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3839,7 +3851,7 @@ final class SearchClientRequestsTests: XCTestCase { /// get searchDictionaryEntries results with all parameters func testSearchDictionaryEntriesTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3875,7 +3887,7 @@ final class SearchClientRequestsTests: XCTestCase { /// get searchForFacetValues results with minimal parameters func testSearchForFacetValuesTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3905,7 +3917,7 @@ final class SearchClientRequestsTests: XCTestCase { /// get searchForFacetValues results with all parameters func testSearchForFacetValuesTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3942,7 +3954,7 @@ final class SearchClientRequestsTests: XCTestCase { /// searchRules0 func testSearchRulesTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -3974,7 +3986,7 @@ final class SearchClientRequestsTests: XCTestCase { /// search with minimal parameters func testSearchSingleIndexTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4003,7 +4015,7 @@ final class SearchClientRequestsTests: XCTestCase { /// search with special characters in indexName func testSearchSingleIndexTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4043,7 +4055,7 @@ final class SearchClientRequestsTests: XCTestCase { /// search with searchParams func testSearchSingleIndexTest2() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4052,11 +4064,11 @@ final class SearchClientRequestsTests: XCTestCase { let response = try await client.searchSingleIndexWithHTTPInfo( indexName: "indexName", - searchParams: SearchParams.searchParamsObject( - SearchParamsObject( + searchParams: SearchSearchParams.searchSearchParamsObject( + SearchSearchParamsObject( query: "myQuery", - facetFilters: FacetFilters.arrayOfMixedSearchFilters( - [MixedSearchFilters.string( + facetFilters: SearchFacetFilters.arrayOfSearchMixedSearchFilters( + [SearchMixedSearchFilters.string( "tags:algolia" )] ) @@ -4082,7 +4094,7 @@ final class SearchClientRequestsTests: XCTestCase { /// single search retrieve snippets func testSearchSingleIndexTest3() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4091,8 +4103,8 @@ final class SearchClientRequestsTests: XCTestCase { let response = try await client.searchSingleIndexWithHTTPInfo( indexName: "cts_e2e_browse", - searchParams: SearchParams.searchParamsObject( - SearchParamsObject( + searchParams: SearchSearchParams.searchSearchParamsObject( + SearchSearchParamsObject( query: "batman mask of the phantasm", attributesToRetrieve: [ "*", @@ -4128,8 +4140,8 @@ final class SearchClientRequestsTests: XCTestCase { let e2eResponse = try await e2eClient.searchSingleIndexWithHTTPInfo( indexName: "cts_e2e_browse", - searchParams: SearchParams.searchParamsObject( - SearchParamsObject( + searchParams: SearchSearchParams.searchSearchParamsObject( + SearchSearchParamsObject( query: "batman mask of the phantasm", attributesToRetrieve: [ "*", @@ -4156,7 +4168,7 @@ final class SearchClientRequestsTests: XCTestCase { /// searchSynonyms with minimal parameters func testSearchSynonymsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4185,7 +4197,7 @@ final class SearchClientRequestsTests: XCTestCase { /// searchSynonyms with all parameters func testSearchSynonymsTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4221,7 +4233,7 @@ final class SearchClientRequestsTests: XCTestCase { /// searchUserIds0 func testSearchUserIdsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4256,7 +4268,7 @@ final class SearchClientRequestsTests: XCTestCase { /// get setDictionarySettings results with minimal parameters func testSetDictionarySettingsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4295,7 +4307,7 @@ final class SearchClientRequestsTests: XCTestCase { /// get setDictionarySettings results with all parameters func testSetDictionarySettingsTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4341,7 +4353,7 @@ final class SearchClientRequestsTests: XCTestCase { /// setSettings with minimal parameters func testSetSettingsTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4395,7 +4407,7 @@ final class SearchClientRequestsTests: XCTestCase { /// setSettings allow boolean `typoTolerance` func testSetSettingsTest1() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4404,7 +4416,7 @@ final class SearchClientRequestsTests: XCTestCase { let response = try await client.setSettingsWithHTTPInfo( indexName: "theIndexName", - indexSettings: IndexSettings(typoTolerance: TypoTolerance.bool( + indexSettings: IndexSettings(typoTolerance: SearchTypoTolerance.bool( true )), forwardToReplicas: true @@ -4434,7 +4446,7 @@ final class SearchClientRequestsTests: XCTestCase { /// setSettings allow enum `typoTolerance` func testSetSettingsTest2() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4443,9 +4455,11 @@ final class SearchClientRequestsTests: XCTestCase { let response = try await client.setSettingsWithHTTPInfo( indexName: "theIndexName", - indexSettings: IndexSettings(typoTolerance: TypoTolerance.typoToleranceEnum( - TypoToleranceEnum.min - )), + indexSettings: IndexSettings( + typoTolerance: SearchTypoTolerance.searchTypoToleranceEnum( + SearchTypoToleranceEnum.min + ) + ), forwardToReplicas: true ) let responseBodyData = try XCTUnwrap(response.bodyData) @@ -4473,7 +4487,7 @@ final class SearchClientRequestsTests: XCTestCase { /// setSettings allow boolean `ignorePlurals` func testSetSettingsTest3() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4482,7 +4496,7 @@ final class SearchClientRequestsTests: XCTestCase { let response = try await client.setSettingsWithHTTPInfo( indexName: "theIndexName", - indexSettings: IndexSettings(ignorePlurals: IgnorePlurals.bool( + indexSettings: IndexSettings(ignorePlurals: SearchIgnorePlurals.bool( true )), forwardToReplicas: true @@ -4512,7 +4526,7 @@ final class SearchClientRequestsTests: XCTestCase { /// setSettings allow list of string `ignorePlurals` func testSetSettingsTest4() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4521,7 +4535,7 @@ final class SearchClientRequestsTests: XCTestCase { let response = try await client.setSettingsWithHTTPInfo( indexName: "theIndexName", - indexSettings: IndexSettings(ignorePlurals: IgnorePlurals.arrayOfString( + indexSettings: IndexSettings(ignorePlurals: SearchIgnorePlurals.arrayOfString( [ "algolia", ] @@ -4553,7 +4567,7 @@ final class SearchClientRequestsTests: XCTestCase { /// setSettings allow boolean `removeStopWords` func testSetSettingsTest5() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4562,7 +4576,7 @@ final class SearchClientRequestsTests: XCTestCase { let response = try await client.setSettingsWithHTTPInfo( indexName: "theIndexName", - indexSettings: IndexSettings(removeStopWords: RemoveStopWords.bool( + indexSettings: IndexSettings(removeStopWords: SearchRemoveStopWords.bool( true )), forwardToReplicas: true @@ -4592,7 +4606,7 @@ final class SearchClientRequestsTests: XCTestCase { /// setSettings allow list of string `removeStopWords` func testSetSettingsTest6() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4601,7 +4615,7 @@ final class SearchClientRequestsTests: XCTestCase { let response = try await client.setSettingsWithHTTPInfo( indexName: "theIndexName", - indexSettings: IndexSettings(removeStopWords: RemoveStopWords.arrayOfString( + indexSettings: IndexSettings(removeStopWords: SearchRemoveStopWords.arrayOfString( [ "algolia", ] @@ -4633,7 +4647,7 @@ final class SearchClientRequestsTests: XCTestCase { /// setSettings allow boolean `distinct` func testSetSettingsTest7() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4642,7 +4656,7 @@ final class SearchClientRequestsTests: XCTestCase { let response = try await client.setSettingsWithHTTPInfo( indexName: "theIndexName", - indexSettings: IndexSettings(distinct: Distinct.bool( + indexSettings: IndexSettings(distinct: SearchDistinct.bool( true )), forwardToReplicas: true @@ -4672,7 +4686,7 @@ final class SearchClientRequestsTests: XCTestCase { /// setSettings allow integers for `distinct` func testSetSettingsTest8() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4681,7 +4695,7 @@ final class SearchClientRequestsTests: XCTestCase { let response = try await client.setSettingsWithHTTPInfo( indexName: "theIndexName", - indexSettings: IndexSettings(distinct: Distinct.int( + indexSettings: IndexSettings(distinct: SearchDistinct.int( 1 )), forwardToReplicas: true @@ -4711,7 +4725,7 @@ final class SearchClientRequestsTests: XCTestCase { /// setSettings allow all `indexSettings` func testSetSettingsTest9() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY ) @@ -4788,17 +4802,17 @@ final class SearchClientRequestsTests: XCTestCase { hitsPerPage: 10, minWordSizefor1Typo: 5, minWordSizefor2Typos: 11, - typoTolerance: TypoTolerance.bool( + typoTolerance: SearchTypoTolerance.bool( false ), allowTyposOnNumericTokens: true, disableTypoToleranceOnAttributes: [ "algolia", ], - ignorePlurals: IgnorePlurals.bool( + ignorePlurals: SearchIgnorePlurals.bool( false ), - removeStopWords: RemoveStopWords.bool( + removeStopWords: SearchRemoveStopWords.bool( false ), keepDiacriticsOnCharacters: "abc", @@ -4808,10 +4822,10 @@ final class SearchClientRequestsTests: XCTestCase { decompoundQuery: false, enableRules: true, enablePersonalization: true, - queryType: QueryType.prefixLast, - removeWordsIfNoResults: RemoveWordsIfNoResults.lastWords, - mode: Mode.neuralSearch, - semanticSearch: SemanticSearch( + queryType: SearchQueryType.prefixLast, + removeWordsIfNoResults: SearchRemoveWordsIfNoResults.lastWords, + mode: SearchMode.neuralSearch, + semanticSearch: SearchSemanticSearch( eventSources: [ "foo", ] @@ -4823,14 +4837,14 @@ final class SearchClientRequestsTests: XCTestCase { disableExactOnAttributes: [ "algolia", ], - exactOnSingleWordQuery: ExactOnSingleWordQuery.attribute, + exactOnSingleWordQuery: SearchExactOnSingleWordQuery.attribute, alternativesAsExact: [ - AlternativesAsExact.singleWordSynonym, + SearchAlternativesAsExact.singleWordSynonym, ], advancedSyntaxFeatures: [ - AdvancedSyntaxFeatures.exactPhrase, + SearchAdvancedSyntaxFeatures.exactPhrase, ], - distinct: Distinct.int( + distinct: SearchDistinct.int( 3 ), replaceSynonymsInHighlight: true, @@ -4842,24 +4856,24 @@ final class SearchClientRequestsTests: XCTestCase { maxValuesPerFacet: 30, sortFacetValuesBy: "date", attributeCriteriaComputedByMinProximity: true, - renderingContent: RenderingContent( - facetOrdering: FacetOrdering( - facets: Facets( + renderingContent: SearchRenderingContent( + facetOrdering: SearchFacetOrdering( + facets: SearchFacets( order: [ "a", "b", ] ), values: [ - "a": Value(order: ["b", - ], - sortRemainingBy: SortRemainingBy.count + "a": SearchValue(order: ["b", + ], + sortRemainingBy: SearchSortRemainingBy.count ), ] ) ), enableReRanking: false, - reRankingApplyFilter: ReRankingApplyFilter.string( + reRankingApplyFilter: SearchReRankingApplyFilter.string( "mySearch:filters" ) ) @@ -4885,7 +4899,7 @@ final class SearchClientRequestsTests: XCTestCase { /// updateApiKey0 func testUpdateApiKeyTest0() async throws { - let configuration: Search.Configuration = try Search.Configuration( + let configuration = try SearchClientConfiguration( appID: SearchClientRequestsTests.APPLICATION_ID, apiKey: SearchClientRequestsTests.API_KEY )