Skip to content

Commit

Permalink
fix(specs): ingestion destinations and transformations (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3477

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
  • Loading branch information
algolia-bot and shortcuts committed Aug 5, 2024
1 parent 0ac26a6 commit b2c5dba
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
14 changes: 14 additions & 0 deletions Sources/Ingestion/IngestionClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2319,16 +2319,22 @@ open class IngestionClient {
)
}

/// - parameter itemsPerPage: (query) Number of items per page. (optional, default to 10)
/// - parameter page: (query) Page number of the paginated API response. (optional)
/// - parameter sort: (query) Property by which to sort the list. (optional)
/// - parameter order: (query) Sort order of the response, ascending or descending. (optional)
/// - returns: ListTransformationsResponse
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open func listTransformations(
itemsPerPage: Int? = nil,
page: Int? = nil,
sort: SortKeys? = nil,
order: OrderKeys? = nil,
requestOptions: RequestOptions? = nil
) async throws -> ListTransformationsResponse {
let response: Response<ListTransformationsResponse> = try await listTransformationsWithHTTPInfo(
itemsPerPage: itemsPerPage,
page: page,
sort: sort,
order: order,
requestOptions: requestOptions
Expand All @@ -2347,19 +2353,27 @@ open class IngestionClient {
// - deleteIndex
// - editSettings
//
// - parameter itemsPerPage: (query) Number of items per page. (optional, default to 10)
//
// - parameter page: (query) Page number of the paginated API response. (optional)
//
// - parameter sort: (query) Property by which to sort the list. (optional)
//
// - parameter order: (query) Sort order of the response, ascending or descending. (optional)
// - returns: RequestBuilder<ListTransformationsResponse>

open func listTransformationsWithHTTPInfo(
itemsPerPage: Int? = nil,
page: Int? = nil,
sort: SortKeys? = nil,
order: OrderKeys? = nil,
requestOptions userRequestOptions: RequestOptions? = nil
) async throws -> Response<ListTransformationsResponse> {
let resourcePath = "/1/transformations"
let body: AnyCodable? = nil
let queryParameters: [String: Any?] = [
"itemsPerPage": itemsPerPage?.encodeToJSON(),
"page": page?.encodeToJSON(),
"sort": sort?.encodeToJSON(),
"order": order?.encodeToJSON(),
]
Expand Down
11 changes: 9 additions & 2 deletions Sources/Ingestion/Models/Destination.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public struct Destination: Codable, JSONEncodable {
public var updatedAt: String?
/// Universally unique identifier (UUID) of an authentication resource.
public var authenticationID: String?
public var transformationIDs: [String]?

public init(
destinationID: String,
Expand All @@ -28,7 +29,8 @@ public struct Destination: Codable, JSONEncodable {
input: DestinationInput,
createdAt: String,
updatedAt: String? = nil,
authenticationID: String? = nil
authenticationID: String? = nil,
transformationIDs: [String]? = nil
) {
self.destinationID = destinationID
self.type = type
Expand All @@ -37,6 +39,7 @@ public struct Destination: Codable, JSONEncodable {
self.createdAt = createdAt
self.updatedAt = updatedAt
self.authenticationID = authenticationID
self.transformationIDs = transformationIDs
}

public enum CodingKeys: String, CodingKey, CaseIterable {
Expand All @@ -47,6 +50,7 @@ public struct Destination: Codable, JSONEncodable {
case createdAt
case updatedAt
case authenticationID
case transformationIDs
}

// Encodable protocol methods
Expand All @@ -60,6 +64,7 @@ public struct Destination: Codable, JSONEncodable {
try container.encode(self.createdAt, forKey: .createdAt)
try container.encodeIfPresent(self.updatedAt, forKey: .updatedAt)
try container.encodeIfPresent(self.authenticationID, forKey: .authenticationID)
try container.encodeIfPresent(self.transformationIDs, forKey: .transformationIDs)
}
}

Expand All @@ -71,7 +76,8 @@ extension Destination: Equatable {
lhs.input == rhs.input &&
lhs.createdAt == rhs.createdAt &&
lhs.updatedAt == rhs.updatedAt &&
lhs.authenticationID == rhs.authenticationID
lhs.authenticationID == rhs.authenticationID &&
lhs.transformationIDs == rhs.transformationIDs
}
}

Expand All @@ -84,5 +90,6 @@ extension Destination: Hashable {
hasher.combine(self.createdAt.hashValue)
hasher.combine(self.updatedAt?.hashValue)
hasher.combine(self.authenticationID?.hashValue)
hasher.combine(self.transformationIDs?.hashValue)
}
}
16 changes: 14 additions & 2 deletions Sources/Ingestion/Models/DestinationCreate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,28 @@ public struct DestinationCreate: Codable, JSONEncodable {
public var input: DestinationInput
/// Universally unique identifier (UUID) of an authentication resource.
public var authenticationID: String?
public var transformationIDs: [String]?

public init(type: DestinationType, name: String, input: DestinationInput, authenticationID: String? = nil) {
public init(
type: DestinationType,
name: String,
input: DestinationInput,
authenticationID: String? = nil,
transformationIDs: [String]? = nil
) {
self.type = type
self.name = name
self.input = input
self.authenticationID = authenticationID
self.transformationIDs = transformationIDs
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case type
case name
case input
case authenticationID
case transformationIDs
}

// Encodable protocol methods
Expand All @@ -37,6 +46,7 @@ public struct DestinationCreate: Codable, JSONEncodable {
try container.encode(self.name, forKey: .name)
try container.encode(self.input, forKey: .input)
try container.encodeIfPresent(self.authenticationID, forKey: .authenticationID)
try container.encodeIfPresent(self.transformationIDs, forKey: .transformationIDs)
}
}

Expand All @@ -45,7 +55,8 @@ extension DestinationCreate: Equatable {
lhs.type == rhs.type &&
lhs.name == rhs.name &&
lhs.input == rhs.input &&
lhs.authenticationID == rhs.authenticationID
lhs.authenticationID == rhs.authenticationID &&
lhs.transformationIDs == rhs.transformationIDs
}
}

Expand All @@ -55,5 +66,6 @@ extension DestinationCreate: Hashable {
hasher.combine(self.name.hashValue)
hasher.combine(self.input.hashValue)
hasher.combine(self.authenticationID?.hashValue)
hasher.combine(self.transformationIDs?.hashValue)
}
}
11 changes: 9 additions & 2 deletions Sources/Ingestion/Models/DestinationUpdate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,28 @@ public struct DestinationUpdate: Codable, JSONEncodable {
public var input: DestinationInput?
/// Universally unique identifier (UUID) of an authentication resource.
public var authenticationID: String?
public var transformationIDs: [String]?

public init(
type: DestinationType? = nil,
name: String? = nil,
input: DestinationInput? = nil,
authenticationID: String? = nil
authenticationID: String? = nil,
transformationIDs: [String]? = nil
) {
self.type = type
self.name = name
self.input = input
self.authenticationID = authenticationID
self.transformationIDs = transformationIDs
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case type
case name
case input
case authenticationID
case transformationIDs
}

// Encodable protocol methods
Expand All @@ -42,6 +46,7 @@ public struct DestinationUpdate: Codable, JSONEncodable {
try container.encodeIfPresent(self.name, forKey: .name)
try container.encodeIfPresent(self.input, forKey: .input)
try container.encodeIfPresent(self.authenticationID, forKey: .authenticationID)
try container.encodeIfPresent(self.transformationIDs, forKey: .transformationIDs)
}
}

Expand All @@ -50,7 +55,8 @@ extension DestinationUpdate: Equatable {
lhs.type == rhs.type &&
lhs.name == rhs.name &&
lhs.input == rhs.input &&
lhs.authenticationID == rhs.authenticationID
lhs.authenticationID == rhs.authenticationID &&
lhs.transformationIDs == rhs.transformationIDs
}
}

Expand All @@ -60,5 +66,6 @@ extension DestinationUpdate: Hashable {
hasher.combine(self.name?.hashValue)
hasher.combine(self.input?.hashValue)
hasher.combine(self.authenticationID?.hashValue)
hasher.combine(self.transformationIDs?.hashValue)
}
}

0 comments on commit b2c5dba

Please sign in to comment.