Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add visionOS to available annotations #41

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Sources/OpenAPIURLSession/BufferedStream/BufferedStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ import DequeModule
/// print("Error: \(error)")
/// }
///
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, visionOS 1, *)
@usableFromInline
internal struct BufferedStream<Element> {
@usableFromInline
Expand Down Expand Up @@ -156,7 +156,7 @@ internal struct BufferedStream<Element> {
let implementation: _Implementation
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, visionOS 1, *)
extension BufferedStream: AsyncSequence {
/// The asynchronous iterator for iterating an asynchronous stream.
///
Expand Down Expand Up @@ -229,7 +229,7 @@ extension BufferedStream: AsyncSequence {
}
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, visionOS 1, *)
extension BufferedStream: Sendable where Element: Sendable {}

@usableFromInline
Expand All @@ -256,7 +256,7 @@ internal struct AlreadyFinishedError: Error {
init() {}
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, visionOS 1, *)
extension BufferedStream {
/// A mechanism to interface between producer code and an asynchronous stream.
///
Expand Down Expand Up @@ -586,7 +586,7 @@ extension BufferedStream {
}
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, visionOS 1, *)
extension BufferedStream {
@usableFromInline
struct _WatermarkBackPressureStrategy: Sendable {
Expand Down Expand Up @@ -691,7 +691,7 @@ extension BufferedStream {
}
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, visionOS 1, *)
extension BufferedStream {
// We are unchecked Sendable since we are protecting our state with a lock.
@usableFromInline
Expand Down Expand Up @@ -1007,7 +1007,7 @@ extension BufferedStream {
}
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, visionOS 1, *)
extension BufferedStream {
/// The state machine of the backpressured async stream.
@usableFromInline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import HTTPTypes
#if canImport(Darwin)
import Foundation

@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) extension URLSession {
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, visionOS 1, *) extension URLSession {
func bidirectionalStreamingRequest(
for request: HTTPRequest,
baseURL: URL,
Expand Down
4 changes: 2 additions & 2 deletions Sources/OpenAPIURLSession/URLSessionTransport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public struct URLSessionTransport: ClientTransport {
switch self.configuration.implemenation {
case .streaming(let requestBodyStreamBufferSize, let responseBodyStreamWatermarks):
#if canImport(Darwin)
guard #available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) else {
guard #available(macOS 12, iOS 15, tvOS 15, watchOS 8, visionOS 1, *) else {
throw URLSessionTransportError.streamingNotSupported
}
return try await configuration.session.bidirectionalStreamingRequest(
Expand Down Expand Up @@ -281,7 +281,7 @@ extension URLSession {
extension URLSessionTransport.Configuration.Implementation {
static var platformSupportsStreaming: Bool {
#if canImport(Darwin)
guard #available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) else { return false }
guard #available(macOS 12, iOS 15, tvOS 15, watchOS 8, visionOS 1, *) else { return false }
_ = URLSession.bidirectionalStreamingRequest
return true
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import XCTest

@testable import OpenAPIURLSession

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, visionOS 1, *)
final class BufferedStreamTests: XCTestCase {
// MARK: - sequenceDeinitialized

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import OpenAPIRuntime
import XCTest
@testable import OpenAPIURLSession

@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) class URLSessionBidirectionalStreamingTests: XCTestCase {
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, visionOS 1, *) class URLSessionBidirectionalStreamingTests: XCTestCase {
// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
static override func setUp() { OpenAPIURLSession.debugLoggingEnabled = false }

Expand Down