Skip to content

Commit 35631ee

Browse files
algolia-botFluf22
andcommitted
fix(swift): prefix and models with the client names (#4132) (generated) [skip ci]
Co-authored-by: Thomas Raffray <[email protected]>
1 parent 989a727 commit 35631ee

File tree

5 files changed

+26
-20
lines changed

5 files changed

+26
-20
lines changed

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,10 +1461,13 @@ open class IngestionClient {
14611461
}
14621462

14631463
/// - parameter taskID: (path) Unique identifier of a task.
1464-
/// - returns: Task
1464+
/// - returns: IngestionTask
14651465
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
1466-
open func getTask(taskID: String, requestOptions: RequestOptions? = nil) async throws -> Task {
1467-
let response: Response<Task> = try await getTaskWithHTTPInfo(taskID: taskID, requestOptions: requestOptions)
1466+
open func getTask(taskID: String, requestOptions: RequestOptions? = nil) async throws -> IngestionTask {
1467+
let response: Response<IngestionTask> = try await getTaskWithHTTPInfo(
1468+
taskID: taskID,
1469+
requestOptions: requestOptions
1470+
)
14681471

14691472
guard let body = response.body else {
14701473
throw AlgoliaError.missingData
@@ -1480,12 +1483,12 @@ open class IngestionClient {
14801483
// - editSettings
14811484
//
14821485
// - parameter taskID: (path) Unique identifier of a task.
1483-
// - returns: RequestBuilder<Task>
1486+
// - returns: RequestBuilder<IngestionTask>
14841487

14851488
open func getTaskWithHTTPInfo(
14861489
taskID: String,
14871490
requestOptions userRequestOptions: RequestOptions? = nil
1488-
) async throws -> Response<Task> {
1491+
) async throws -> Response<IngestionTask> {
14891492
guard !taskID.isEmpty else {
14901493
throw AlgoliaError.invalidArgument("taskID", "getTask")
14911494
}
@@ -2808,10 +2811,13 @@ open class IngestionClient {
28082811
}
28092812

28102813
/// - parameter taskSearch: (body)
2811-
/// - returns: [Task]
2814+
/// - returns: [IngestionTask]
28122815
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
2813-
open func searchTasks(taskSearch: TaskSearch, requestOptions: RequestOptions? = nil) async throws -> [Task] {
2814-
let response: Response<[Task]> = try await searchTasksWithHTTPInfo(
2816+
open func searchTasks(
2817+
taskSearch: TaskSearch,
2818+
requestOptions: RequestOptions? = nil
2819+
) async throws -> [IngestionTask] {
2820+
let response: Response<[IngestionTask]> = try await searchTasksWithHTTPInfo(
28152821
taskSearch: taskSearch,
28162822
requestOptions: requestOptions
28172823
)
@@ -2830,12 +2836,12 @@ open class IngestionClient {
28302836
// - editSettings
28312837
//
28322838
// - parameter taskSearch: (body)
2833-
// - returns: RequestBuilder<[Task]>
2839+
// - returns: RequestBuilder<[IngestionTask]>
28342840

28352841
open func searchTasksWithHTTPInfo(
28362842
taskSearch: TaskSearch,
28372843
requestOptions userRequestOptions: RequestOptions? = nil
2838-
) async throws -> Response<[Task]> {
2844+
) async throws -> Response<[IngestionTask]> {
28392845
let resourcePath = "/2/tasks/search"
28402846
let body = taskSearch
28412847
let queryParameters: [String: Any?]? = nil

clients/algoliasearch-client-swift/Sources/Ingestion/Models/Task.swift renamed to clients/algoliasearch-client-swift/Sources/Ingestion/Models/IngestionTask.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Foundation
66
import Core
77
#endif
88

9-
public struct Task: Codable, JSONEncodable {
9+
public struct IngestionTask: Codable, JSONEncodable {
1010
/// Universally unique identifier (UUID) of a task.
1111
public var taskID: String
1212
/// Universally uniqud identifier (UUID) of a source.
@@ -98,8 +98,8 @@ public struct Task: Codable, JSONEncodable {
9898
}
9999
}
100100

101-
extension Task: Equatable {
102-
public static func ==(lhs: Task, rhs: Task) -> Bool {
101+
extension IngestionTask: Equatable {
102+
public static func ==(lhs: IngestionTask, rhs: IngestionTask) -> Bool {
103103
lhs.taskID == rhs.taskID &&
104104
lhs.sourceID == rhs.sourceID &&
105105
lhs.destinationID == rhs.destinationID &&
@@ -116,7 +116,7 @@ extension Task: Equatable {
116116
}
117117
}
118118

119-
extension Task: Hashable {
119+
extension IngestionTask: Hashable {
120120
public func hash(into hasher: inout Hasher) {
121121
hasher.combine(self.taskID.hashValue)
122122
hasher.combine(self.sourceID.hashValue)

clients/algoliasearch-client-swift/Sources/Ingestion/Models/ListTasksResponse.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import Foundation
88

99
/// Configured tasks and pagination information.
1010
public struct ListTasksResponse: Codable, JSONEncodable {
11-
public var tasks: [Task]
11+
public var tasks: [IngestionTask]
1212
public var pagination: Pagination
1313

14-
public init(tasks: [Task], pagination: Pagination) {
14+
public init(tasks: [IngestionTask], pagination: Pagination) {
1515
self.tasks = tasks
1616
self.pagination = pagination
1717
}

clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/LogFile.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99
public struct LogFile: Codable, JSONEncodable {
1010
/// Date and time of the log entry, in RFC 3339 format.
1111
public var timestamp: String?
12-
public var level: ModelLogLevel?
12+
public var level: QuerySuggestionsLogLevel?
1313
/// Details about this log entry.
1414
public var message: String?
1515
/// Level indicating the position of a suggestion in a hierarchy of records. For example, a `contextLevel` of 1
@@ -18,7 +18,7 @@ public struct LogFile: Codable, JSONEncodable {
1818

1919
public init(
2020
timestamp: String? = nil,
21-
level: ModelLogLevel? = nil,
21+
level: QuerySuggestionsLogLevel? = nil,
2222
message: String? = nil,
2323
contextLevel: Int? = nil
2424
) {

clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/ModelLogLevel.swift renamed to clients/algoliasearch-client-swift/Sources/QuerySuggestions/Models/QuerySuggestionsLogLevel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import Foundation
99
/// Type of log entry. - `SKIP`. A query is skipped because it doesn't match the conditions for successful inclusion.
1010
/// For example, when a query doesn't generate enough search results. - `INFO`. An informative log entry. - `ERROR`. The
1111
/// Query Suggestions process encountered an error.
12-
public enum ModelLogLevel: String, Codable, CaseIterable {
12+
public enum QuerySuggestionsLogLevel: String, Codable, CaseIterable {
1313
case skip = "SKIP"
1414
case info = "INFO"
1515
case error = "ERROR"
1616
}
1717

18-
extension ModelLogLevel: Hashable {}
18+
extension QuerySuggestionsLogLevel: Hashable {}

0 commit comments

Comments
 (0)