Skip to content

Commit

Permalink
fix(specs): enable watcher for push [skip-bc] (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4229

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
  • Loading branch information
algolia-bot and shortcuts committed Dec 11, 2024
1 parent 7716554 commit 875bc75
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
40 changes: 20 additions & 20 deletions Sources/Ingestion/IngestionClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2424,15 +2424,15 @@ open class IngestionClient {
/// Connectors pipeline.
/// - parameter watch: (query) When provided, the push operation will be synchronous and the API will wait for the
/// ingestion to be finished before responding. (optional)
/// - returns: RunResponse
/// - returns: WatchResponse
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open func pushTask(
taskID: String,
pushTaskPayload: PushTaskPayload,
watch: Bool? = nil,
requestOptions: RequestOptions? = nil
) async throws -> RunResponse {
let response: Response<RunResponse> = try await pushTaskWithHTTPInfo(
) async throws -> WatchResponse {
let response: Response<WatchResponse> = try await pushTaskWithHTTPInfo(
taskID: taskID,
pushTaskPayload: pushTaskPayload,
watch: watch,
Expand Down Expand Up @@ -2460,14 +2460,14 @@ open class IngestionClient {
//
// - parameter watch: (query) When provided, the push operation will be synchronous and the API will wait for the
// ingestion to be finished before responding. (optional)
// - returns: RequestBuilder<RunResponse>
// - returns: RequestBuilder<WatchResponse>

open func pushTaskWithHTTPInfo(
taskID: String,
pushTaskPayload: PushTaskPayload,
watch: Bool? = nil,
requestOptions userRequestOptions: RequestOptions? = nil
) async throws -> Response<RunResponse> {
) async throws -> Response<WatchResponse> {
guard !taskID.isEmpty else {
throw AlgoliaError.invalidArgument("taskID", "pushTask")
}
Expand Down Expand Up @@ -2969,13 +2969,13 @@ open class IngestionClient {
}

/// - parameter sourceID: (path) Unique identifier of a source.
/// - returns: SourceWatchResponse
/// - returns: WatchResponse
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open func triggerDockerSourceDiscover(
sourceID: String,
requestOptions: RequestOptions? = nil
) async throws -> SourceWatchResponse {
let response: Response<SourceWatchResponse> = try await triggerDockerSourceDiscoverWithHTTPInfo(
) async throws -> WatchResponse {
let response: Response<WatchResponse> = try await triggerDockerSourceDiscoverWithHTTPInfo(
sourceID: sourceID,
requestOptions: requestOptions
)
Expand All @@ -2995,12 +2995,12 @@ open class IngestionClient {
// - editSettings
//
// - parameter sourceID: (path) Unique identifier of a source.
// - returns: RequestBuilder<SourceWatchResponse>
// - returns: RequestBuilder<WatchResponse>

open func triggerDockerSourceDiscoverWithHTTPInfo(
sourceID: String,
requestOptions userRequestOptions: RequestOptions? = nil
) async throws -> Response<SourceWatchResponse> {
) async throws -> Response<WatchResponse> {
guard !sourceID.isEmpty else {
throw AlgoliaError.invalidArgument("sourceID", "triggerDockerSourceDiscover")
}
Expand Down Expand Up @@ -3539,13 +3539,13 @@ open class IngestionClient {
}

/// - parameter sourceCreate: (body) (optional)
/// - returns: SourceWatchResponse
/// - returns: WatchResponse
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open func validateSource(
sourceCreate: SourceCreate? = nil,
requestOptions: RequestOptions? = nil
) async throws -> SourceWatchResponse {
let response: Response<SourceWatchResponse> = try await validateSourceWithHTTPInfo(
) async throws -> WatchResponse {
let response: Response<WatchResponse> = try await validateSourceWithHTTPInfo(
sourceCreate: sourceCreate,
requestOptions: requestOptions
)
Expand All @@ -3564,12 +3564,12 @@ open class IngestionClient {
// - editSettings
//
// - parameter sourceCreate: (body) (optional)
// - returns: RequestBuilder<SourceWatchResponse>
// - returns: RequestBuilder<WatchResponse>

open func validateSourceWithHTTPInfo(
sourceCreate: SourceCreate? = nil,
requestOptions userRequestOptions: RequestOptions? = nil
) async throws -> Response<SourceWatchResponse> {
) async throws -> Response<WatchResponse> {
let resourcePath = "/1/sources/validate"
let body = sourceCreate
let queryParameters: [String: Any?]? = nil
Expand All @@ -3588,14 +3588,14 @@ open class IngestionClient {

/// - parameter sourceID: (path) Unique identifier of a source.
/// - parameter sourceUpdate: (body)
/// - returns: SourceWatchResponse
/// - returns: WatchResponse
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open func validateSourceBeforeUpdate(
sourceID: String,
sourceUpdate: SourceUpdate,
requestOptions: RequestOptions? = nil
) async throws -> SourceWatchResponse {
let response: Response<SourceWatchResponse> = try await validateSourceBeforeUpdateWithHTTPInfo(
) async throws -> WatchResponse {
let response: Response<WatchResponse> = try await validateSourceBeforeUpdateWithHTTPInfo(
sourceID: sourceID,
sourceUpdate: sourceUpdate,
requestOptions: requestOptions
Expand All @@ -3618,13 +3618,13 @@ open class IngestionClient {
// - parameter sourceID: (path) Unique identifier of a source.
//
// - parameter sourceUpdate: (body)
// - returns: RequestBuilder<SourceWatchResponse>
// - returns: RequestBuilder<WatchResponse>

open func validateSourceBeforeUpdateWithHTTPInfo(
sourceID: String,
sourceUpdate: SourceUpdate,
requestOptions userRequestOptions: RequestOptions? = nil
) async throws -> Response<SourceWatchResponse> {
) async throws -> Response<WatchResponse> {
guard !sourceID.isEmpty else {
throw AlgoliaError.invalidArgument("sourceID", "validateSourceBeforeUpdate")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import Foundation
import Core
#endif

public struct SourceWatchResponse: Codable, JSONEncodable {
public struct WatchResponse: Codable, JSONEncodable {
/// Universally unique identifier (UUID) of a task run.
public var runID: String?
/// depending on the source type, the validation returns sampling data of your source (JSON, CSV, BigQuery).
/// when used with discovering or validating sources, the sampled data of your source is returned.
public var data: [AnyCodable]?
/// in case of error, observability events will be added to the response, if any.
public var events: [Event]?
Expand Down Expand Up @@ -41,16 +41,16 @@ public struct SourceWatchResponse: Codable, JSONEncodable {
}
}

extension SourceWatchResponse: Equatable {
public static func ==(lhs: SourceWatchResponse, rhs: SourceWatchResponse) -> Bool {
extension WatchResponse: Equatable {
public static func ==(lhs: WatchResponse, rhs: WatchResponse) -> Bool {
lhs.runID == rhs.runID &&
lhs.data == rhs.data &&
lhs.events == rhs.events &&
lhs.message == rhs.message
}
}

extension SourceWatchResponse: Hashable {
extension WatchResponse: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.runID?.hashValue)
hasher.combine(self.data?.hashValue)
Expand Down

0 comments on commit 875bc75

Please sign in to comment.