Skip to content

Commit

Permalink
chore: revert wrong commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Fluf22 committed Jan 29, 2024
1 parent 443396e commit aa99adc
Show file tree
Hide file tree
Showing 11 changed files with 10,160 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.

public struct Version {
public let major: Int
public let minor: Int
public let patch: Int
public let prereleaseIdentifier: String?

public init(major: Int, minor: Int, patch: Int = 0, prereleaseIdentifier: String? = nil) {
self.major = major
self.minor = minor
self.patch = patch
self.prereleaseIdentifier = prereleaseIdentifier
}

public init(version: String) {
let components = version.components(separatedBy: ".")

guard components.count >= 3 else {
fatalError("version is not formatted correctly")
}

major = Int(components[0]) ?? 0
minor = Int(components[1]) ?? 0
patch = Int(components[2]) ?? 0
prereleaseIdentifier = components.count == 4 ? components[3] : nil
}
}

extension Version: CustomStringConvertible {
public var description: String {
let main = [major, minor, patch].map(String.init).joined(separator: ".")
if let prereleaseIdentifier = prereleaseIdentifier {
return main + "-\(prereleaseIdentifier)"
} else {
return main
}
}
}

public extension Version {
static let current: Version = .init(version: "9.0.0-alpha.2")
}
58 changes: 58 additions & 0 deletions tests/output/swift/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// swift-tools-version: 5.9
//

import PackageDescription

let package = Package(
name: "AlgoliaSearchClientTests",
dependencies: [
.package(url: "https://github.com/Flight-School/AnyCodable", .upToNextMajor(from: "0.6.1")),
.package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "5.0.0"),
.package(path: "../../../clients/algoliasearch-client-swift"),
],
targets: [
.testTarget(
name: "requests",
dependencies: [
.product(name: "AnyCodable", package: "AnyCodable"),
.product(name: "SwiftyJSON", package: "SwiftyJSON"),
.product(
name: "Abtesting",
package: "algoliasearch-client-swift"
),
.product(
name: "Analytics",
package: "algoliasearch-client-swift"
),
.product(
name: "Ingestion",
package: "algoliasearch-client-swift"
),
.product(
name: "Insights",
package: "algoliasearch-client-swift"
),
.product(
name: "Monitoring",
package: "algoliasearch-client-swift"
),
.product(
name: "Personalization",
package: "algoliasearch-client-swift"
),
.product(
name: "QuerySuggestions",
package: "algoliasearch-client-swift"
),
.product(
name: "Recommend",
package: "algoliasearch-client-swift"
),
.product(
name: "Search",
package: "algoliasearch-client-swift"
),
]
)
]
)
Loading

0 comments on commit aa99adc

Please # to comment.