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

Decode response header data from Codable userInfo #565

Merged
merged 10 commits into from
Jul 18, 2023
2 changes: 1 addition & 1 deletion Sources/SotoCore/AWSClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ extension AWSClient {
url: URL,
httpMethod: HTTPMethod,
headers: HTTPHeaders = HTTPHeaders(),
body: HTTPBody,
body: AWSHTTPBody,
serviceConfig: AWSServiceConfig,
logger: Logger = AWSClient.loggingDisabled
) async throws -> HTTPHeaders {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SotoCore/AWSService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ extension AWSService {
url: URL,
httpMethod: HTTPMethod,
headers: HTTPHeaders = HTTPHeaders(),
body: HTTPBody = .init(),
body: AWSHTTPBody = .init(),
logger: Logger = AWSClient.loggingDisabled
) async throws -> HTTPHeaders {
return try await self.client.signHeaders(url: url, httpMethod: httpMethod, headers: headers, body: body, serviceConfig: self.config, logger: logger)
Expand Down
2 changes: 1 addition & 1 deletion Sources/SotoCore/Concurrency/AnyAsyncSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public struct AnyAsyncSequence<Element>: Sendable, AsyncSequence {

@usableFromInline var makeAsyncIteratorCallback: @Sendable () -> AsyncIteratorNextCallback

@inlinable init<SequenceOfBytes>(
@inlinable public init<SequenceOfBytes>(
_ asyncSequence: SequenceOfBytes
) where SequenceOfBytes: AsyncSequence & Sendable, SequenceOfBytes.Element == Element {
self.makeAsyncIteratorCallback = {
Expand Down
8 changes: 4 additions & 4 deletions Sources/SotoCore/Doc/AWSShape.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ public extension AWSEncodableShape {
guard value.base64count <= max else { throw Self.validationError("Length of \(parent).\(name) (\(value.base64count)) is greater than the maximum allowed value \(max).") }
}

func validate(_ value: HTTPBody, name: String, parent: String, min: Int) throws {
func validate(_ value: AWSHTTPBody, name: String, parent: String, min: Int) throws {
if let size = value.length {
guard size >= min else {
throw Self.validationError("Length of \(parent).\(name) (\(size)) is less than minimum allowed value \(min).")
}
}
}

func validate(_ value: HTTPBody, name: String, parent: String, max: Int) throws {
func validate(_ value: AWSHTTPBody, name: String, parent: String, max: Int) throws {
if let size = value.length {
guard size <= max else {
throw Self.validationError("Length of \(parent).\(name) (\(size)) is greater than the maximum allowed value \(max).")
Expand Down Expand Up @@ -205,12 +205,12 @@ public extension AWSEncodableShape {
try validate(value, name: name, parent: parent, max: max)
}

func validate(_ value: HTTPBody?, name: String, parent: String, min: Int) throws {
func validate(_ value: AWSHTTPBody?, name: String, parent: String, min: Int) throws {
guard let value = value else { return }
try validate(value, name: name, parent: parent, min: min)
}

func validate(_ value: HTTPBody?, name: String, parent: String, max: Int) throws {
func validate(_ value: AWSHTTPBody?, name: String, parent: String, max: Int) throws {
guard let value = value else { return }
try validate(value, name: name, parent: parent, max: max)
}
Expand Down
Loading