diff --git a/Sources/Soto/Extensions/S3/S3+SelectObjectContent.swift b/Sources/Soto/Extensions/S3/S3+SelectObjectContent.swift deleted file mode 100644 index 42768b74d0..0000000000 --- a/Sources/Soto/Extensions/S3/S3+SelectObjectContent.swift +++ /dev/null @@ -1,192 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Soto for AWS open source project -// -// Copyright (c) 2017-2020 the Soto project authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of Soto project authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -import Crypto -import Foundation -import NIOCore -import SotoCore -import SotoXML - -// TODO: Reimplement SelectObjectContent - -// MARK: SelectObjectContent EventStream - -public enum S3SelectError: Error { - case corruptHeader - case corruptPayload - case selectContentError(String) -} - -extension S3.SelectObjectContentEventStream { - public static func consume(byteBuffer: inout ByteBuffer) throws -> Self? { - // read header values from ByteBuffer. Format is uint8 name length, name, 7, uint16 value length, value - func readHeaderValues(_ byteBuffer: ByteBuffer) throws -> [String: String] { - var byteBuffer = byteBuffer - var headers: [String: String] = [:] - while byteBuffer.readableBytes > 0 { - guard let headerLength: UInt8 = byteBuffer.readInteger(), - let header: String = byteBuffer.readString(length: Int(headerLength)), - let byte: UInt8 = byteBuffer.readInteger(), byte == 7, - let valueLength: UInt16 = byteBuffer.readInteger(), - let value: String = byteBuffer.readString(length: Int(valueLength)) - else { - throw S3SelectError.corruptHeader - } - headers[header] = value - } - return headers - } - - let rootElement = XML.Element(name: "Payload") - - guard byteBuffer.readableBytes > 0 else { return nil } - - // get prelude buffer and crc. Return nil if we don't have enough data - guard var preludeBuffer = byteBuffer.getSlice(at: byteBuffer.readerIndex, length: 8) else { return nil } - guard let preludeCRC: UInt32 = byteBuffer.getInteger(at: byteBuffer.readerIndex + 8) else { return nil } - // verify crc - let calculatedPreludeCRC = soto_crc32(0, bytes: ByteBufferView(preludeBuffer)) - guard UInt(preludeCRC) == calculatedPreludeCRC else { throw S3SelectError.corruptPayload } - // get lengths - guard let totalLength: Int32 = preludeBuffer.readInteger(), - let headerLength: Int32 = preludeBuffer.readInteger() else { return nil } - - // get message and message CRC. Return nil if we don't have enough data - guard var messageBuffer = byteBuffer.readSlice(length: Int(totalLength - 4)), - let messageCRC: UInt32 = byteBuffer.readInteger() else { return nil } - // verify message CRC - let calculatedCRC = soto_crc32(0, bytes: ByteBufferView(messageBuffer)) - guard UInt(messageCRC) == calculatedCRC else { throw S3SelectError.corruptPayload } - - // skip past prelude - messageBuffer.moveReaderIndex(forwardBy: 12) - - // get headers - guard let headerBuffer: ByteBuffer = messageBuffer.readSlice(length: Int(headerLength)) else { - throw S3SelectError.corruptHeader - } - let headers = try readHeaderValues(headerBuffer) - if headers[":message-type"] == "error" { - throw S3SelectError.selectContentError(headers[":error-code"] ?? "Unknown") - } - - let payloadSize = Int(totalLength - headerLength - 16) - - switch headers[":event-type"] { - case "Records": - guard let data = messageBuffer.readData(length: payloadSize) else { throw S3SelectError.corruptPayload } - let payloadElement = XML.Element(name: "Payload", stringValue: data.base64EncodedString()) - let recordsElement = XML.Element(name: "Records") - recordsElement.addChild(payloadElement) - rootElement.addChild(recordsElement) - - case "Cont": - guard payloadSize == 0 else { throw S3SelectError.corruptPayload } - let contElement = XML.Element(name: "Cont") - rootElement.addChild(contElement) - - case "Progress": - guard let data = messageBuffer.readData(length: payloadSize) else { throw S3SelectError.corruptPayload } - let xmlElement = try XML.Element(xmlData: data) - xmlElement.name = "Details" - let progressElement = XML.Element(name: "Progress") - progressElement.addChild(xmlElement) - rootElement.addChild(progressElement) - - case "Stats": - guard let data = messageBuffer.readData(length: payloadSize) else { throw S3SelectError.corruptPayload } - let xmlElement = try XML.Element(xmlData: data) - xmlElement.name = "Details" - let statsElement = XML.Element(name: "Stats") - statsElement.addChild(xmlElement) - rootElement.addChild(statsElement) - - case "End": - let endElement = XML.Element(name: "End") - rootElement.addChild(endElement) - - default: - throw S3SelectError.corruptPayload - } - - return try XMLDecoder().decode(S3.SelectObjectContentEventStream.self, from: rootElement) - } -} - -extension S3 { - /// This operation filters the contents of an Amazon S3 object based on a simple structured query language (SQL) statement. In the request, along with the SQL expression, you must also specify a data serialization format (JSON, CSV, or Apache Parquet) of the object. Amazon S3 uses this format to parse object data into records, and returns only records that match the specified SQL expression. You must also specify the data serialization format for the response. - /// - /// This action is not supported by Amazon S3 on Outposts. - /// - /// For more information about Amazon S3 Select, see Selecting Content from Objects in the Amazon Simple Storage Service Developer Guide. - /// - /// For more information about using SQL with Amazon S3 Select, see SQL Reference for Amazon S3 Select and S3 Glacier Select in the Amazon Simple Storage Service Developer Guide.

Permissions - /// - /// You must have `s3:GetObject` permission for this operation. Amazon S3 Select does not support anonymous access. For more information about permissions, see Specifying Permissions in a Policy in the Amazon Simple Storage Service Developer Guide.

Object Data Formats - /// - /// You can use Amazon S3 Select to query objects that have the following format properties:

Working with the Response Body - /// - /// Given the response size is unknown, Amazon S3 Select streams the response as a series of messages and includes a `Transfer-Encoding` header with `chunked` as its value in the response. For more information, see Appendix: SelectObjectContent Response .

GetObject Support - /// - /// The `SelectObjectContent` operation does not support the following `GetObject` functionality. For more information, see GetObject.

Special Errors - /// - /// For a list of special errors for this operation, see List of SELECT Object Content Error Codes

Related Resources

- /// - /// - Parameters: - /// - input: Request structure - /// - stream: callback to process events streamed - /// - Returns: Response structure - public func selectObjectContentEventStream( - _ input: SelectObjectContentRequest, - logger: Logger = AWSClient.loggingDisabled - ) async throws -> SelectObjectContentOutput { - // byte buffer for storing unprocessed data - // var selectByteBuffer: ByteBuffer? - return try await client.execute( - operation: "SelectObjectContent", - path: "/{Bucket}/{Key+}?select&select-type=2", - httpMethod: .POST, - serviceConfig: config, - input: input, - logger: logger - ) - // TODO: Reimplement SelectObjectContent - /* - { (byteBuffer: ByteBuffer, eventLoop: EventLoop) in - var byteBuffer = byteBuffer - if var selectByteBuffer2 = selectByteBuffer { - selectByteBuffer2.writeBuffer(&byteBuffer) - byteBuffer = selectByteBuffer2 - selectByteBuffer = nil - } - do { - var events: [SelectObjectContentEventStream] = [] - while let event = try SelectObjectContentEventStream.consume(byteBuffer: &byteBuffer) { - events.append(event) - } - if byteBuffer.readableBytes > 0 { - selectByteBuffer = byteBuffer - } - let streamFutures = events.map { stream($0, eventLoop) } - return EventLoopFuture.andAllSucceed(streamFutures, on: eventLoop) - } catch { - return eventLoop.makeFailedFuture(error) - } - }*/ - } -} diff --git a/Sources/Soto/Services/APIGateway/APIGateway_shapes.swift b/Sources/Soto/Services/APIGateway/APIGateway_shapes.swift index a25506495b..9743eb50a0 100644 --- a/Sources/Soto/Services/APIGateway/APIGateway_shapes.swift +++ b/Sources/Soto/Services/APIGateway/APIGateway_shapes.swift @@ -2922,7 +2922,6 @@ extension APIGateway { public struct ImportApiKeysRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "failOnWarnings", location: .querystring("failonwarnings")), AWSMemberEncoding(label: "format", location: .querystring("format")) @@ -2947,7 +2946,6 @@ extension APIGateway { public struct ImportDocumentationPartsRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "failOnWarnings", location: .querystring("failonwarnings")), AWSMemberEncoding(label: "mode", location: .querystring("mode")), @@ -2976,7 +2974,6 @@ extension APIGateway { public struct ImportRestApiRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "failOnWarnings", location: .querystring("failonwarnings")) ] @@ -3608,7 +3605,6 @@ extension APIGateway { public struct PutRestApiRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "failOnWarnings", location: .querystring("failonwarnings")), AWSMemberEncoding(label: "mode", location: .querystring("mode")), diff --git a/Sources/Soto/Services/ApiGatewayManagementApi/ApiGatewayManagementApi_shapes.swift b/Sources/Soto/Services/ApiGatewayManagementApi/ApiGatewayManagementApi_shapes.swift index 90ddb6a85d..0180af12d6 100644 --- a/Sources/Soto/Services/ApiGatewayManagementApi/ApiGatewayManagementApi_shapes.swift +++ b/Sources/Soto/Services/ApiGatewayManagementApi/ApiGatewayManagementApi_shapes.swift @@ -98,7 +98,6 @@ extension ApiGatewayManagementApi { public struct PostToConnectionRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "data" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "connectionId", location: .uri("ConnectionId")) ] diff --git a/Sources/Soto/Services/AppConfig/AppConfig_shapes.swift b/Sources/Soto/Services/AppConfig/AppConfig_shapes.swift index 85435da13d..2e472de7c8 100644 --- a/Sources/Soto/Services/AppConfig/AppConfig_shapes.swift +++ b/Sources/Soto/Services/AppConfig/AppConfig_shapes.swift @@ -667,7 +667,6 @@ extension AppConfig { public struct CreateHostedConfigurationVersionRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "content" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "applicationId", location: .uri("ApplicationId")), AWSMemberEncoding(label: "configurationProfileId", location: .uri("ConfigurationProfileId")), diff --git a/Sources/Soto/Services/BackupStorage/BackupStorage_shapes.swift b/Sources/Soto/Services/BackupStorage/BackupStorage_shapes.swift index 406ee18ae3..85b193e5f5 100644 --- a/Sources/Soto/Services/BackupStorage/BackupStorage_shapes.swift +++ b/Sources/Soto/Services/BackupStorage/BackupStorage_shapes.swift @@ -139,7 +139,7 @@ extension BackupStorage { } public struct GetChunkOutput: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// Data checksum public let checksum: String /// Checksum algorithm @@ -188,7 +188,7 @@ extension BackupStorage { } public struct GetObjectMetadataOutput: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// Metadata blob. public let metadataBlob: AWSHTTPBody /// MetadataBlob checksum. @@ -334,7 +334,7 @@ extension BackupStorage { public struct NotifyObjectCompleteInput: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "metadataBlob" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming, .allowChunkedStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming, .allowChunkedStreaming] public static var _encoding = [ AWSMemberEncoding(label: "backupJobId", location: .uri("BackupJobId")), AWSMemberEncoding(label: "metadataBlobChecksum", location: .querystring("metadata-checksum")), @@ -404,7 +404,7 @@ extension BackupStorage { public struct PutChunkInput: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "data" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming, .allowChunkedStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming, .allowChunkedStreaming] public static var _encoding = [ AWSMemberEncoding(label: "backupJobId", location: .uri("BackupJobId")), AWSMemberEncoding(label: "checksum", location: .querystring("checksum")), @@ -462,7 +462,7 @@ extension BackupStorage { public struct PutObjectInput: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "inlineChunk" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming, .allowChunkedStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming, .allowChunkedStreaming] public static var _encoding = [ AWSMemberEncoding(label: "backupJobId", location: .uri("BackupJobId")), AWSMemberEncoding(label: "inlineChunkChecksum", location: .querystring("checksum")), diff --git a/Sources/Soto/Services/CloudSearchDomain/CloudSearchDomain_shapes.swift b/Sources/Soto/Services/CloudSearchDomain/CloudSearchDomain_shapes.swift index 1aed3741f0..55830853b8 100644 --- a/Sources/Soto/Services/CloudSearchDomain/CloudSearchDomain_shapes.swift +++ b/Sources/Soto/Services/CloudSearchDomain/CloudSearchDomain_shapes.swift @@ -393,7 +393,7 @@ extension CloudSearchDomain { public struct UploadDocumentsRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "documents" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming] public static var _encoding = [ AWSMemberEncoding(label: "contentType", location: .header("Content-Type")) ] diff --git a/Sources/Soto/Services/CodeArtifact/CodeArtifact_shapes.swift b/Sources/Soto/Services/CodeArtifact/CodeArtifact_shapes.swift index 19ebb9c387..e113500d6c 100644 --- a/Sources/Soto/Services/CodeArtifact/CodeArtifact_shapes.swift +++ b/Sources/Soto/Services/CodeArtifact/CodeArtifact_shapes.swift @@ -1387,7 +1387,7 @@ extension CodeArtifact { } public struct GetPackageVersionAssetResult: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The binary file, or asset, that is downloaded. public let asset: AWSHTTPBody /// The name of the asset that is downloaded. @@ -2469,7 +2469,7 @@ extension CodeArtifact { public struct PublishPackageVersionRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "assetContent" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming] public static var _encoding = [ AWSMemberEncoding(label: "assetName", location: .querystring("asset")), AWSMemberEncoding(label: "assetSHA256", location: .header("x-amz-content-sha256")), diff --git a/Sources/Soto/Services/CodeGuruProfiler/CodeGuruProfiler_shapes.swift b/Sources/Soto/Services/CodeGuruProfiler/CodeGuruProfiler_shapes.swift index 78d214af16..6e298cc8bf 100644 --- a/Sources/Soto/Services/CodeGuruProfiler/CodeGuruProfiler_shapes.swift +++ b/Sources/Soto/Services/CodeGuruProfiler/CodeGuruProfiler_shapes.swift @@ -1171,7 +1171,6 @@ extension CodeGuruProfiler { public struct PostAgentProfileRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "agentProfile" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "contentType", location: .header("Content-Type")), AWSMemberEncoding(label: "profileToken", location: .querystring("profileToken")), diff --git a/Sources/Soto/Services/EBS/EBS_shapes.swift b/Sources/Soto/Services/EBS/EBS_shapes.swift index 57de041e83..e04b944af3 100644 --- a/Sources/Soto/Services/EBS/EBS_shapes.swift +++ b/Sources/Soto/Services/EBS/EBS_shapes.swift @@ -169,7 +169,7 @@ extension EBS { } public struct GetSnapshotBlockResponse: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The data content of the block. public let blockData: AWSHTTPBody /// The checksum generated for the block, which is Base64 encoded. @@ -342,7 +342,7 @@ extension EBS { public struct PutSnapshotBlockRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "blockData" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming, .allowChunkedStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming, .allowChunkedStreaming] public static var _encoding = [ AWSMemberEncoding(label: "blockIndex", location: .uri("BlockIndex")), AWSMemberEncoding(label: "checksum", location: .header("x-amz-Checksum")), diff --git a/Sources/Soto/Services/Glacier/Glacier_shapes.swift b/Sources/Soto/Services/Glacier/Glacier_shapes.swift index ce6f71923b..028104f14d 100644 --- a/Sources/Soto/Services/Glacier/Glacier_shapes.swift +++ b/Sources/Soto/Services/Glacier/Glacier_shapes.swift @@ -605,7 +605,7 @@ extension Glacier { } public struct GetJobOutputOutput: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// Indicates the range units accepted. For more information, see RFC2616. public let acceptRanges: String? /// The description of an archive. @@ -1674,7 +1674,7 @@ extension Glacier { public struct UploadArchiveInput: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming] public static var _encoding = [ AWSMemberEncoding(label: "accountId", location: .uri("accountId")), AWSMemberEncoding(label: "archiveDescription", location: .header("x-amz-archive-description")), @@ -1736,7 +1736,7 @@ extension Glacier { public struct UploadMultipartPartInput: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming] public static var _encoding = [ AWSMemberEncoding(label: "accountId", location: .uri("accountId")), AWSMemberEncoding(label: "checksum", location: .header("x-amz-sha256-tree-hash")), diff --git a/Sources/Soto/Services/IoTDataPlane/IoTDataPlane_shapes.swift b/Sources/Soto/Services/IoTDataPlane/IoTDataPlane_shapes.swift index 20256a2baf..b26e21f6b2 100644 --- a/Sources/Soto/Services/IoTDataPlane/IoTDataPlane_shapes.swift +++ b/Sources/Soto/Services/IoTDataPlane/IoTDataPlane_shapes.swift @@ -266,7 +266,6 @@ extension IoTDataPlane { public struct PublishRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "payload" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "contentType", location: .querystring("contentType")), AWSMemberEncoding(label: "correlationData", location: .header("x-amz-mqtt5-correlation-data")), @@ -349,7 +348,6 @@ extension IoTDataPlane { public struct UpdateThingShadowRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "payload" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "shadowName", location: .querystring("name")), AWSMemberEncoding(label: "thingName", location: .uri("thingName")) diff --git a/Sources/Soto/Services/IoTWireless/IoTWireless_shapes.swift b/Sources/Soto/Services/IoTWireless/IoTWireless_shapes.swift index c6eb37a215..736ab0d392 100644 --- a/Sources/Soto/Services/IoTWireless/IoTWireless_shapes.swift +++ b/Sources/Soto/Services/IoTWireless/IoTWireless_shapes.swift @@ -7299,7 +7299,6 @@ extension IoTWireless { public struct UpdateResourcePositionRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "geoJsonPayload" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "resourceIdentifier", location: .uri("ResourceIdentifier")), AWSMemberEncoding(label: "resourceType", location: .querystring("resourceType")) diff --git a/Sources/Soto/Services/Kinesis/Kinesis_shapes.swift b/Sources/Soto/Services/Kinesis/Kinesis_shapes.swift index 86038797bd..63c40e8b69 100644 --- a/Sources/Soto/Services/Kinesis/Kinesis_shapes.swift +++ b/Sources/Soto/Services/Kinesis/Kinesis_shapes.swift @@ -1902,15 +1902,19 @@ extension Kinesis { public struct SubscribeToShardOutput: AWSDecodableShape { /// The event stream that your consumer can use to read records from the shard. - public let eventStream: SubscribeToShardEventStream + public let eventStream: AWSEventStream - public init(eventStream: SubscribeToShardEventStream) { + public init(eventStream: AWSEventStream) { self.eventStream = eventStream } - private enum CodingKeys: String, CodingKey { - case eventStream = "EventStream" + public init(from decoder: Decoder) throws { + let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer + self.eventStream = response.decodeEventStream() + } + + private enum CodingKeys: CodingKey {} } public struct Tag: AWSDecodableShape { diff --git a/Sources/Soto/Services/KinesisVideoArchivedMedia/KinesisVideoArchivedMedia_shapes.swift b/Sources/Soto/Services/KinesisVideoArchivedMedia/KinesisVideoArchivedMedia_shapes.swift index d808352c44..28f1af6c39 100644 --- a/Sources/Soto/Services/KinesisVideoArchivedMedia/KinesisVideoArchivedMedia_shapes.swift +++ b/Sources/Soto/Services/KinesisVideoArchivedMedia/KinesisVideoArchivedMedia_shapes.swift @@ -266,7 +266,7 @@ extension KinesisVideoArchivedMedia { } public struct GetClipOutput: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The content type of the media in the requested clip. public let contentType: String? /// Traditional MP4 file that contains the media clip from the specified video stream. The output will contain the first 100 MB or the first 200 fragments from the specified start timestamp. For more information, see Kinesis Video Streams Limits. @@ -563,7 +563,7 @@ extension KinesisVideoArchivedMedia { } public struct GetMediaForFragmentListOutput: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The content type of the requested media. public let contentType: String? /// The payload that Kinesis Video Streams returns is a sequence of chunks from the specified stream. For information about the chunks, see PutMedia. The chunks that Kinesis Video Streams returns in the GetMediaForFragmentList call also include the following additional Matroska (MKV) tags: AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk. AWS_KINESISVIDEO_SERVER_SIDE_TIMESTAMP - Server-side timestamp of the fragment. AWS_KINESISVIDEO_PRODUCER_SIDE_TIMESTAMP - Producer-side timestamp of the fragment. The following tags will be included if an exception occurs: AWS_KINESISVIDEO_FRAGMENT_NUMBER - The number of the fragment that threw the exception AWS_KINESISVIDEO_EXCEPTION_ERROR_CODE - The integer code of the exception AWS_KINESISVIDEO_EXCEPTION_MESSAGE - A text description of the exception diff --git a/Sources/Soto/Services/KinesisVideoMedia/KinesisVideoMedia_shapes.swift b/Sources/Soto/Services/KinesisVideoMedia/KinesisVideoMedia_shapes.swift index 2758c8314d..90afb45d86 100644 --- a/Sources/Soto/Services/KinesisVideoMedia/KinesisVideoMedia_shapes.swift +++ b/Sources/Soto/Services/KinesisVideoMedia/KinesisVideoMedia_shapes.swift @@ -70,7 +70,7 @@ extension KinesisVideoMedia { } public struct GetMediaOutput: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The content type of the requested media. public let contentType: String? /// The payload Kinesis Video Streams returns is a sequence of chunks from the specified stream. For information about the chunks, see . The chunks that Kinesis Video Streams returns in the GetMedia call also include the following additional Matroska (MKV) tags: AWS_KINESISVIDEO_CONTINUATION_TOKEN (UTF-8 string) - In the event your GetMedia call terminates, you can use this continuation token in your next request to get the next chunk where the last request terminated. AWS_KINESISVIDEO_MILLIS_BEHIND_NOW (UTF-8 string) - Client applications can use this tag value to determine how far behind the chunk returned in the response is from the latest chunk on the stream. AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the chunk. AWS_KINESISVIDEO_SERVER_TIMESTAMP - Server timestamp of the fragment. AWS_KINESISVIDEO_PRODUCER_TIMESTAMP - Producer timestamp of the fragment. The following tags will be present if an error occurs: AWS_KINESISVIDEO_ERROR_CODE - String description of an error that caused GetMedia to stop. AWS_KINESISVIDEO_ERROR_ID: Integer code of the error. The error codes are as follows: 3002 - Error writing to the stream 4000 - Requested fragment is not found 4500 - Access denied for the stream's KMS key 4501 - Stream's KMS key is disabled 4502 - Validation error on the stream's KMS key 4503 - KMS key specified in the stream is unavailable 4504 - Invalid usage of the KMS key specified in the stream 4505 - Invalid state of the KMS key specified in the stream 4506 - Unable to find the KMS key specified in the stream 5000 - Internal error diff --git a/Sources/Soto/Services/LakeFormation/LakeFormation_shapes.swift b/Sources/Soto/Services/LakeFormation/LakeFormation_shapes.swift index 190adc26ff..e7d5920d0f 100644 --- a/Sources/Soto/Services/LakeFormation/LakeFormation_shapes.swift +++ b/Sources/Soto/Services/LakeFormation/LakeFormation_shapes.swift @@ -1711,7 +1711,7 @@ extension LakeFormation { } public struct GetWorkUnitResultsResponse: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// Rows returned from the GetWorkUnitResults operation as a stream of Apache Arrow v1.0 messages. public let resultStream: AWSHTTPBody diff --git a/Sources/Soto/Services/Lambda/Lambda_shapes.swift b/Sources/Soto/Services/Lambda/Lambda_shapes.swift index 5fe922177e..8293a57174 100644 --- a/Sources/Soto/Services/Lambda/Lambda_shapes.swift +++ b/Sources/Soto/Services/Lambda/Lambda_shapes.swift @@ -2694,7 +2694,6 @@ extension Lambda { public struct InvocationRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "payload" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "clientContext", location: .header("X-Amz-Client-Context")), AWSMemberEncoding(label: "functionName", location: .uri("FunctionName")), @@ -2774,7 +2773,7 @@ extension Lambda { public struct InvokeAsyncRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "invokeArgs" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming] public static var _encoding = [ AWSMemberEncoding(label: "functionName", location: .uri("FunctionName")) ] @@ -2816,16 +2815,24 @@ extension Lambda { } public struct InvokeResponseStreamUpdate: AWSDecodableShape { + public static var _encoding = [ + AWSMemberEncoding(label: "payload", location: .body("Payload")) + ] + /// Data returned by your Lambda function. - public let payload: AWSBase64Data? + public let payload: ByteBuffer - public init(payload: AWSBase64Data? = nil) { + public init(payload: ByteBuffer) { self.payload = payload } - private enum CodingKeys: String, CodingKey { - case payload = "Payload" + public init(from decoder: Decoder) throws { + let response = decoder.userInfo[.awsEvent]! as! EventDecodingContainer + self.payload = response.decodePayload() + } + + private enum CodingKeys: CodingKey {} } public struct InvokeWithResponseStreamCompleteEvent: AWSDecodableShape { @@ -2852,7 +2859,6 @@ extension Lambda { public struct InvokeWithResponseStreamRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "payload" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "clientContext", location: .header("X-Amz-Client-Context")), AWSMemberEncoding(label: "functionName", location: .uri("FunctionName")), @@ -2896,8 +2902,9 @@ extension Lambda { } public struct InvokeWithResponseStreamResponse: AWSDecodableShape { + public static let _options: AWSShapeOptions = [.rawPayload] /// The stream of response payloads. - public let eventStream: InvokeWithResponseStreamResponseEvent + public let eventStream: AWSEventStream /// The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to. public let executedVersion: String? /// The type of data the stream is returning. @@ -2905,7 +2912,7 @@ extension Lambda { /// For a successful request, the HTTP status code is in the 200 range. For the RequestResponse invocation type, this status code is 200. For the DryRun invocation type, this status code is 204. public let statusCode: Int? - public init(eventStream: InvokeWithResponseStreamResponseEvent, executedVersion: String? = nil, responseStreamContentType: String? = nil, statusCode: Int? = nil) { + public init(eventStream: AWSEventStream, executedVersion: String? = nil, responseStreamContentType: String? = nil, statusCode: Int? = nil) { self.eventStream = eventStream self.executedVersion = executedVersion self.responseStreamContentType = responseStreamContentType @@ -2914,7 +2921,7 @@ extension Lambda { public init(from decoder: Decoder) throws { let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer - self.eventStream = try .init(from: decoder) + self.eventStream = response.decodeEventStream() self.executedVersion = try response.decodeIfPresent(String.self, forHeader: "X-Amz-Executed-Version") self.responseStreamContentType = try response.decodeIfPresent(String.self, forHeader: "Content-Type") self.statusCode = response.decodeStatus() diff --git a/Sources/Soto/Services/LexRuntimeService/LexRuntimeService_shapes.swift b/Sources/Soto/Services/LexRuntimeService/LexRuntimeService_shapes.swift index 956e63cf7b..18cdf61416 100644 --- a/Sources/Soto/Services/LexRuntimeService/LexRuntimeService_shapes.swift +++ b/Sources/Soto/Services/LexRuntimeService/LexRuntimeService_shapes.swift @@ -399,7 +399,7 @@ extension LexRuntimeService { public struct PostContentRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "inputStream" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming, .allowChunkedStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming, .allowChunkedStreaming] public static var _encoding = [ AWSMemberEncoding(label: "accept", location: .header("Accept")), AWSMemberEncoding(label: "activeContexts", location: .header("x-amz-lex-active-contexts")), @@ -452,7 +452,7 @@ extension LexRuntimeService { } public struct PostContentResponse: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// A list of active contexts for the session. A context can be set when an intent is fulfilled or by calling the PostContent, PostText, or PutSession operation. You can use a context to control the intents that can follow up an intent, or to modify the operation of your application. public let activeContexts: String? /// One to four alternative intents that may be applicable to the user's intent. Each alternative includes a score that indicates how confident Amazon Lex is that the intent matches the user's intent. The intents are sorted by the confidence score. @@ -758,7 +758,7 @@ extension LexRuntimeService { } public struct PutSessionResponse: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// A list of active contexts for the session. public let activeContexts: String? /// The audio version of the message to convey to the user. diff --git a/Sources/Soto/Services/LexRuntimeV2/LexRuntimeV2_shapes.swift b/Sources/Soto/Services/LexRuntimeV2/LexRuntimeV2_shapes.swift index ee66e3464e..ee42f0607c 100644 --- a/Sources/Soto/Services/LexRuntimeV2/LexRuntimeV2_shapes.swift +++ b/Sources/Soto/Services/LexRuntimeV2/LexRuntimeV2_shapes.swift @@ -1024,7 +1024,7 @@ extension LexRuntimeV2 { } public struct PutSessionResponse: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// If the requested content type was audio, the audio version of the message to convey to the user. public let audioStream: AWSHTTPBody /// The type of response. Same as the type specified in the responseContentType field in the request. @@ -1153,7 +1153,7 @@ extension LexRuntimeV2 { public struct RecognizeUtteranceRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "inputStream" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming, .allowChunkedStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming, .allowChunkedStreaming] public static var _encoding = [ AWSMemberEncoding(label: "botAliasId", location: .uri("botAliasId")), AWSMemberEncoding(label: "botId", location: .uri("botId")), @@ -1212,7 +1212,7 @@ extension LexRuntimeV2 { } public struct RecognizeUtteranceResponse: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The prompt or statement to send to the user. This is based on the bot configuration and context. For example, if Amazon Lex V2 did not understand the user intent, it sends the clarificationPrompt configured for the bot. If the intent requires confirmation before taking the fulfillment action, it sends the confirmationPrompt. Another example: Suppose that the Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon Lex V2 sends that message in the response. public let audioStream: AWSHTTPBody /// Content type as specified in the responseContentType in the request. @@ -1508,11 +1508,11 @@ extension LexRuntimeV2 { /// The locale where the session is in use. public let localeId: String /// Represents the stream of events to Amazon Lex V2 from your application. The events are encoded as HTTP/2 data frames. - public let requestEventStream: StartConversationRequestEventStream + public let requestEventStream: AWSEventStream /// The identifier of the user session that is having the conversation. public let sessionId: String - public init(botAliasId: String, botId: String, conversationMode: ConversationMode? = nil, localeId: String, requestEventStream: StartConversationRequestEventStream, sessionId: String) { + public init(botAliasId: String, botId: String, conversationMode: ConversationMode? = nil, localeId: String, requestEventStream: AWSEventStream, sessionId: String) { self.botAliasId = botAliasId self.botId = botId self.conversationMode = conversationMode @@ -1526,7 +1526,6 @@ extension LexRuntimeV2 { try self.validate(self.botId, name: "botId", parent: name, min: 10) try self.validate(self.botId, name: "botId", parent: name, pattern: "^[0-9a-zA-Z]+$") try self.validate(self.localeId, name: "localeId", parent: name, min: 1) - try self.requestEventStream.validate(name: "\(name).requestEventStream") try self.validate(self.sessionId, name: "sessionId", parent: name, max: 100) try self.validate(self.sessionId, name: "sessionId", parent: name, min: 2) try self.validate(self.sessionId, name: "sessionId", parent: name, pattern: "^[0-9a-zA-Z._:-]+$") @@ -1536,15 +1535,17 @@ extension LexRuntimeV2 { } public struct StartConversationResponse: AWSDecodableShape { + public static let _options: AWSShapeOptions = [.rawPayload] /// Represents the stream of events from Amazon Lex V2 to your application. The events are encoded as HTTP/2 data frames. - public let responseEventStream: StartConversationResponseEventStream + public let responseEventStream: AWSEventStream - public init(responseEventStream: StartConversationResponseEventStream) { + public init(responseEventStream: AWSEventStream) { self.responseEventStream = responseEventStream } public init(from decoder: Decoder) throws { - self.responseEventStream = try .init(from: decoder) + let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer + self.responseEventStream = response.decodeEventStream() } diff --git a/Sources/Soto/Services/LookoutVision/LookoutVision_shapes.swift b/Sources/Soto/Services/LookoutVision/LookoutVision_shapes.swift index 299043ec56..736b66de5e 100644 --- a/Sources/Soto/Services/LookoutVision/LookoutVision_shapes.swift +++ b/Sources/Soto/Services/LookoutVision/LookoutVision_shapes.swift @@ -684,7 +684,7 @@ extension LookoutVision { public struct DetectAnomaliesRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming] public static var _encoding = [ AWSMemberEncoding(label: "contentType", location: .header("Content-Type")), AWSMemberEncoding(label: "modelVersion", location: .uri("ModelVersion")), diff --git a/Sources/Soto/Services/MediaLive/MediaLive_shapes.swift b/Sources/Soto/Services/MediaLive/MediaLive_shapes.swift index 2e5aad352e..75c54db9ef 100644 --- a/Sources/Soto/Services/MediaLive/MediaLive_shapes.swift +++ b/Sources/Soto/Services/MediaLive/MediaLive_shapes.swift @@ -4322,7 +4322,7 @@ extension MediaLive { } public struct DescribeInputDeviceThumbnailResponse: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The binary data for the thumbnail that the Link device has most recently sent to MediaLive. public let body: AWSHTTPBody /// The length of the content. diff --git a/Sources/Soto/Services/MediaStoreData/MediaStoreData_shapes.swift b/Sources/Soto/Services/MediaStoreData/MediaStoreData_shapes.swift index c111db6150..32ee46f5dd 100644 --- a/Sources/Soto/Services/MediaStoreData/MediaStoreData_shapes.swift +++ b/Sources/Soto/Services/MediaStoreData/MediaStoreData_shapes.swift @@ -152,7 +152,7 @@ extension MediaStoreData { } public struct GetObjectResponse: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The bytes of the object. public let body: AWSHTTPBody /// An optional CacheControl header that allows the caller to control the object's cache behavior. Headers can be passed in as specified in the HTTP spec at https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9. Headers with a custom user-defined value are also accepted. @@ -281,7 +281,7 @@ extension MediaStoreData { public struct PutObjectRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming, .allowChunkedStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming, .allowChunkedStreaming] public static var _encoding = [ AWSMemberEncoding(label: "cacheControl", location: .header("Cache-Control")), AWSMemberEncoding(label: "contentType", location: .header("Content-Type")), diff --git a/Sources/Soto/Services/Mobile/Mobile_shapes.swift b/Sources/Soto/Services/Mobile/Mobile_shapes.swift index eb126b9fd8..b177860b61 100644 --- a/Sources/Soto/Services/Mobile/Mobile_shapes.swift +++ b/Sources/Soto/Services/Mobile/Mobile_shapes.swift @@ -76,7 +76,6 @@ extension Mobile { public struct CreateProjectRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "contents" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "name", location: .querystring("name")), AWSMemberEncoding(label: "region", location: .querystring("region")), @@ -428,7 +427,6 @@ extension Mobile { public struct UpdateProjectRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "contents" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "projectId", location: .querystring("projectId")) ] diff --git a/Sources/Soto/Services/Omics/Omics_shapes.swift b/Sources/Soto/Services/Omics/Omics_shapes.swift index 756464bd69..bd2bc8e45b 100644 --- a/Sources/Soto/Services/Omics/Omics_shapes.swift +++ b/Sources/Soto/Services/Omics/Omics_shapes.swift @@ -2237,7 +2237,7 @@ extension Omics { } public struct GetReadSetResponse: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The read set file payload. public let payload: AWSHTTPBody @@ -2444,7 +2444,7 @@ extension Omics { } public struct GetReferenceResponse: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The reference file payload. public let payload: AWSHTTPBody @@ -6087,7 +6087,7 @@ extension Omics { public struct UploadReadSetPartRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "payload" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming] public static var _encoding = [ AWSMemberEncoding(label: "partNumber", location: .querystring("partNumber")), AWSMemberEncoding(label: "partSource", location: .querystring("partSource")), diff --git a/Sources/Soto/Services/Polly/Polly_shapes.swift b/Sources/Soto/Services/Polly/Polly_shapes.swift index de6208eaec..d76faa319c 100644 --- a/Sources/Soto/Services/Polly/Polly_shapes.swift +++ b/Sources/Soto/Services/Polly/Polly_shapes.swift @@ -725,7 +725,7 @@ extension Polly { } public struct SynthesizeSpeechOutput: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// Stream containing the synthesized speech. public let audioStream: AWSHTTPBody /// Specifies the type audio stream. This should reflect the OutputFormat parameter in your request. If you request mp3 as the OutputFormat, the ContentType returned is audio/mpeg. If you request ogg_vorbis as the OutputFormat, the ContentType returned is audio/ogg. If you request pcm as the OutputFormat, the ContentType returned is audio/pcm in a signed 16-bit, 1 channel (mono), little-endian format. If you request json as the OutputFormat, the ContentType returned is application/x-json-stream. diff --git a/Sources/Soto/Services/S3/S3_shapes.swift b/Sources/Soto/Services/S3/S3_shapes.swift index d81fff0613..ce92ae8dfa 100644 --- a/Sources/Soto/Services/S3/S3_shapes.swift +++ b/Sources/Soto/Services/S3/S3_shapes.swift @@ -3714,7 +3714,7 @@ extension S3 { } public struct GetObjectOutput: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// Indicates that a range of bytes was specified. public let acceptRanges: String? /// Object data. @@ -4087,7 +4087,7 @@ extension S3 { } public struct GetObjectTorrentOutput: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// A Bencoded dictionary as defined by the BitTorrent specification public let body: AWSHTTPBody public let requestCharged: RequestCharged? @@ -6217,16 +6217,23 @@ extension S3 { } public struct ProgressEvent: AWSDecodableShape { + public static var _encoding = [ + AWSMemberEncoding(label: "details", location: .body("Details")) + ] + /// The Progress event details. - public let details: Progress? + public let details: Progress - public init(details: Progress? = nil) { + public init(details: Progress) { self.details = details } - private enum CodingKeys: String, CodingKey { - case details = "Details" + public init(from decoder: Decoder) throws { + self.details = try .init(from: decoder) + } + + private enum CodingKeys: CodingKey {} } public struct PublicAccessBlockConfiguration: AWSEncodableShape & AWSDecodableShape { @@ -7168,7 +7175,7 @@ extension S3 { public struct PutObjectRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.checksumHeader, .md5ChecksumHeader, .rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.checksumHeader, .md5ChecksumHeader, .allowStreaming] public static var _encoding = [ AWSMemberEncoding(label: "acl", location: .header("x-amz-acl")), AWSMemberEncoding(label: "bucket", location: .uri("Bucket")), @@ -7525,16 +7532,24 @@ extension S3 { } public struct RecordsEvent: AWSDecodableShape { + public static var _encoding = [ + AWSMemberEncoding(label: "payload", location: .body("Payload")) + ] + /// The byte array of partial, one or more result records. - public let payload: AWSBase64Data? + public let payload: ByteBuffer - public init(payload: AWSBase64Data? = nil) { + public init(payload: ByteBuffer) { self.payload = payload } - private enum CodingKeys: String, CodingKey { - case payload = "Payload" + public init(from decoder: Decoder) throws { + let response = decoder.userInfo[.awsEvent]! as! EventDecodingContainer + self.payload = response.decodePayload() + } + + private enum CodingKeys: CodingKey {} } public struct Redirect: AWSEncodableShape & AWSDecodableShape { @@ -7977,15 +7992,17 @@ extension S3 { } public struct SelectObjectContentOutput: AWSDecodableShape { + public static let _options: AWSShapeOptions = [.rawPayload] /// The array of results. - public let payload: SelectObjectContentEventStream + public let payload: AWSEventStream - public init(payload: SelectObjectContentEventStream) { + public init(payload: AWSEventStream) { self.payload = payload } public init(from decoder: Decoder) throws { - self.payload = try .init(from: decoder) + let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer + self.payload = response.decodeEventStream() } @@ -8180,16 +8197,23 @@ extension S3 { } public struct StatsEvent: AWSDecodableShape { + public static var _encoding = [ + AWSMemberEncoding(label: "details", location: .body("Details")) + ] + /// The Stats event details. - public let details: Stats? + public let details: Stats - public init(details: Stats? = nil) { + public init(details: Stats) { self.details = details } - private enum CodingKeys: String, CodingKey { - case details = "Details" + public init(from decoder: Decoder) throws { + self.details = try .init(from: decoder) + } + + private enum CodingKeys: CodingKey {} } public struct StorageClassAnalysis: AWSEncodableShape & AWSDecodableShape { @@ -8540,7 +8564,7 @@ extension S3 { public struct UploadPartRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.checksumHeader, .md5ChecksumHeader, .rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.checksumHeader, .md5ChecksumHeader, .allowStreaming] public static var _encoding = [ AWSMemberEncoding(label: "bucket", location: .uri("Bucket")), AWSMemberEncoding(label: "checksumAlgorithm", location: .header("x-amz-sdk-checksum-algorithm")), @@ -8673,7 +8697,7 @@ extension S3 { public struct WriteGetObjectResponseRequest: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming, .allowChunkedStreaming] + public static let _options: AWSShapeOptions = [.allowStreaming, .allowChunkedStreaming] public static var _encoding = [ AWSMemberEncoding(label: "acceptRanges", location: .header("x-amz-fwd-header-accept-ranges")), AWSMemberEncoding(label: "bucketKeyEnabled", location: .header("x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled")), diff --git a/Sources/Soto/Services/SageMakerGeospatial/SageMakerGeospatial_shapes.swift b/Sources/Soto/Services/SageMakerGeospatial/SageMakerGeospatial_shapes.swift index 7a0fef8bbd..9b114551e5 100644 --- a/Sources/Soto/Services/SageMakerGeospatial/SageMakerGeospatial_shapes.swift +++ b/Sources/Soto/Services/SageMakerGeospatial/SageMakerGeospatial_shapes.swift @@ -1217,7 +1217,7 @@ extension SageMakerGeospatial { } public struct GetTileOutput: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The output binary file. public let binaryFile: AWSHTTPBody diff --git a/Sources/Soto/Services/SageMakerRuntime/SageMakerRuntime_shapes.swift b/Sources/Soto/Services/SageMakerRuntime/SageMakerRuntime_shapes.swift index fc927fa217..9628bef6ec 100644 --- a/Sources/Soto/Services/SageMakerRuntime/SageMakerRuntime_shapes.swift +++ b/Sources/Soto/Services/SageMakerRuntime/SageMakerRuntime_shapes.swift @@ -123,7 +123,6 @@ extension SageMakerRuntime { public struct InvokeEndpointInput: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "body" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "accept", location: .header("Accept")), AWSMemberEncoding(label: "contentType", location: .header("Content-Type")), diff --git a/Sources/Soto/Services/Tnb/Tnb_shapes.swift b/Sources/Soto/Services/Tnb/Tnb_shapes.swift index d4633e3499..493976fc97 100644 --- a/Sources/Soto/Services/Tnb/Tnb_shapes.swift +++ b/Sources/Soto/Services/Tnb/Tnb_shapes.swift @@ -1742,7 +1742,6 @@ extension Tnb { public struct PutSolFunctionPackageContentInput: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "file" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "contentType", location: .header("Content-Type")), AWSMemberEncoding(label: "vnfPkgId", location: .uri("vnfPkgId")) @@ -1816,7 +1815,6 @@ extension Tnb { public struct PutSolNetworkPackageContentInput: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "file" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "contentType", location: .header("Content-Type")), AWSMemberEncoding(label: "nsdInfoId", location: .uri("nsdInfoId")) @@ -2171,7 +2169,6 @@ extension Tnb { public struct ValidateSolFunctionPackageContentInput: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "file" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "contentType", location: .header("Content-Type")), AWSMemberEncoding(label: "vnfPkgId", location: .uri("vnfPkgId")) @@ -2245,7 +2242,6 @@ extension Tnb { public struct ValidateSolNetworkPackageContentInput: AWSEncodableShape & AWSShapeWithPayload { /// The key for the payload public static let _payloadPath: String = "file" - public static let _options: AWSShapeOptions = [.rawPayload] public static var _encoding = [ AWSMemberEncoding(label: "contentType", location: .header("Content-Type")), AWSMemberEncoding(label: "nsdInfoId", location: .uri("nsdInfoId")) diff --git a/Sources/Soto/Services/TranscribeStreaming/TranscribeStreaming_shapes.swift b/Sources/Soto/Services/TranscribeStreaming/TranscribeStreaming_shapes.swift index e6d08a2458..3c323e5c11 100644 --- a/Sources/Soto/Services/TranscribeStreaming/TranscribeStreaming_shapes.swift +++ b/Sources/Soto/Services/TranscribeStreaming/TranscribeStreaming_shapes.swift @@ -352,15 +352,13 @@ extension TranscribeStreaming { public struct AudioEvent: AWSEncodableShape { /// An audio blob that contains the next part of the audio that you want to transcribe. The maximum audio chunk size is 32 KB. - public let audioChunk: AWSBase64Data? + public let audioChunk: ByteBuffer? - public init(audioChunk: AWSBase64Data? = nil) { + public init(audioChunk: ByteBuffer? = nil) { self.audioChunk = audioChunk } - private enum CodingKeys: String, CodingKey { - case audioChunk = "AudioChunk" - } + private enum CodingKeys: CodingKey {} } public struct BadRequestException: AWSDecodableShape { @@ -919,7 +917,7 @@ extension TranscribeStreaming { AWSMemberEncoding(label: "vocabularyName", location: .header("x-amzn-transcribe-vocabulary-name")) ] - public let audioStream: AudioStream + public let audioStream: AWSEventStream /// Labels all personally identifiable information (PII) identified in your transcript. Content identification is performed at the segment level; PII specified in PiiEntityTypes is flagged upon complete transcription of an audio segment. You can’t set ContentIdentificationType and ContentRedactionType in the same request. If you set both, your request returns a BadRequestException. For more information, see Redacting or identifying personally identifiable information. public let contentIdentificationType: ContentIdentificationType? /// Redacts all personally identifiable information (PII) identified in your transcript. Content redaction is performed at the segment level; PII specified in PiiEntityTypes is redacted upon complete transcription of an audio segment. You can’t set ContentRedactionType and ContentIdentificationType in the same request. If you set both, your request returns a BadRequestException. For more information, see Redacting or identifying personally identifiable information. @@ -947,7 +945,7 @@ extension TranscribeStreaming { /// Specify the name of the custom vocabulary that you want to use when processing your transcription. Note that vocabulary names are case sensitive. If the language of the specified custom vocabulary doesn't match the language identified in your media, the custom vocabulary is not applied to your transcription. For more information, see Custom vocabularies. public let vocabularyName: String? - public init(audioStream: AudioStream, contentIdentificationType: ContentIdentificationType? = nil, contentRedactionType: ContentRedactionType? = nil, enablePartialResultsStabilization: Bool? = nil, languageCode: CallAnalyticsLanguageCode, languageModelName: String? = nil, mediaEncoding: MediaEncoding, mediaSampleRateHertz: Int, partialResultsStability: PartialResultsStability? = nil, piiEntityTypes: String? = nil, sessionId: String? = nil, vocabularyFilterMethod: VocabularyFilterMethod? = nil, vocabularyFilterName: String? = nil, vocabularyName: String? = nil) { + public init(audioStream: AWSEventStream, contentIdentificationType: ContentIdentificationType? = nil, contentRedactionType: ContentRedactionType? = nil, enablePartialResultsStabilization: Bool? = nil, languageCode: CallAnalyticsLanguageCode, languageModelName: String? = nil, mediaEncoding: MediaEncoding, mediaSampleRateHertz: Int, partialResultsStability: PartialResultsStability? = nil, piiEntityTypes: String? = nil, sessionId: String? = nil, vocabularyFilterMethod: VocabularyFilterMethod? = nil, vocabularyFilterName: String? = nil, vocabularyName: String? = nil) { self.audioStream = audioStream self.contentIdentificationType = contentIdentificationType self.contentRedactionType = contentRedactionType @@ -965,7 +963,6 @@ extension TranscribeStreaming { } public func validate(name: String) throws { - try self.audioStream.validate(name: "\(name).audioStream") try self.validate(self.languageModelName, name: "languageModelName", parent: name, max: 200) try self.validate(self.languageModelName, name: "languageModelName", parent: name, min: 1) try self.validate(self.languageModelName, name: "languageModelName", parent: name, pattern: "^[0-9a-zA-Z._-]+$") @@ -989,8 +986,9 @@ extension TranscribeStreaming { } public struct StartCallAnalyticsStreamTranscriptionResponse: AWSDecodableShape { + public static let _options: AWSShapeOptions = [.rawPayload] /// Provides detailed information about your Call Analytics streaming session. - public let callAnalyticsTranscriptResultStream: CallAnalyticsTranscriptResultStream + public let callAnalyticsTranscriptResultStream: AWSEventStream /// Shows whether content identification was enabled for your Call Analytics transcription. public let contentIdentificationType: ContentIdentificationType? /// Shows whether content redaction was enabled for your Call Analytics transcription. @@ -1020,7 +1018,7 @@ extension TranscribeStreaming { /// Provides the name of the custom vocabulary that you specified in your Call Analytics request. public let vocabularyName: String? - public init(callAnalyticsTranscriptResultStream: CallAnalyticsTranscriptResultStream, contentIdentificationType: ContentIdentificationType? = nil, contentRedactionType: ContentRedactionType? = nil, enablePartialResultsStabilization: Bool? = nil, languageCode: CallAnalyticsLanguageCode? = nil, languageModelName: String? = nil, mediaEncoding: MediaEncoding? = nil, mediaSampleRateHertz: Int? = nil, partialResultsStability: PartialResultsStability? = nil, piiEntityTypes: String? = nil, requestId: String? = nil, sessionId: String? = nil, vocabularyFilterMethod: VocabularyFilterMethod? = nil, vocabularyFilterName: String? = nil, vocabularyName: String? = nil) { + public init(callAnalyticsTranscriptResultStream: AWSEventStream, contentIdentificationType: ContentIdentificationType? = nil, contentRedactionType: ContentRedactionType? = nil, enablePartialResultsStabilization: Bool? = nil, languageCode: CallAnalyticsLanguageCode? = nil, languageModelName: String? = nil, mediaEncoding: MediaEncoding? = nil, mediaSampleRateHertz: Int? = nil, partialResultsStability: PartialResultsStability? = nil, piiEntityTypes: String? = nil, requestId: String? = nil, sessionId: String? = nil, vocabularyFilterMethod: VocabularyFilterMethod? = nil, vocabularyFilterName: String? = nil, vocabularyName: String? = nil) { self.callAnalyticsTranscriptResultStream = callAnalyticsTranscriptResultStream self.contentIdentificationType = contentIdentificationType self.contentRedactionType = contentRedactionType @@ -1040,7 +1038,7 @@ extension TranscribeStreaming { public init(from decoder: Decoder) throws { let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer - self.callAnalyticsTranscriptResultStream = try .init(from: decoder) + self.callAnalyticsTranscriptResultStream = response.decodeEventStream() self.contentIdentificationType = try response.decodeIfPresent(ContentIdentificationType.self, forHeader: "x-amzn-transcribe-content-identification-type") self.contentRedactionType = try response.decodeIfPresent(ContentRedactionType.self, forHeader: "x-amzn-transcribe-content-redaction-type") self.enablePartialResultsStabilization = try response.decodeIfPresent(Bool.self, forHeader: "x-amzn-transcribe-enable-partial-results-stabilization") @@ -1079,7 +1077,7 @@ extension TranscribeStreaming { AWSMemberEncoding(label: "vocabularyName", location: .header("x-amzn-transcribe-vocabulary-name")) ] - public let audioStream: AudioStream + public let audioStream: AWSEventStream /// Labels all personal health information (PHI) identified in your transcript. Content identification is performed at the segment level; PHI is flagged upon complete transcription of an audio segment. For more information, see Identifying personal health information (PHI) in a transcription. public let contentIdentificationType: MedicalContentIdentificationType? /// Enables channel identification in multi-channel audio. Channel identification transcribes the audio on each channel independently, then appends the output for each channel into one transcript. If you have multi-channel audio and do not enable channel identification, your audio is transcribed in a continuous manner and your transcript is not separated by channel. For more information, see Transcribing multi-channel audio. @@ -1103,7 +1101,7 @@ extension TranscribeStreaming { /// Specify the name of the custom vocabulary that you want to use when processing your transcription. Note that vocabulary names are case sensitive. public let vocabularyName: String? - public init(audioStream: AudioStream, contentIdentificationType: MedicalContentIdentificationType? = nil, enableChannelIdentification: Bool? = nil, languageCode: LanguageCode, mediaEncoding: MediaEncoding, mediaSampleRateHertz: Int, numberOfChannels: Int? = nil, sessionId: String? = nil, showSpeakerLabel: Bool? = nil, specialty: Specialty, type: `Type`, vocabularyName: String? = nil) { + public init(audioStream: AWSEventStream, contentIdentificationType: MedicalContentIdentificationType? = nil, enableChannelIdentification: Bool? = nil, languageCode: LanguageCode, mediaEncoding: MediaEncoding, mediaSampleRateHertz: Int, numberOfChannels: Int? = nil, sessionId: String? = nil, showSpeakerLabel: Bool? = nil, specialty: Specialty, type: `Type`, vocabularyName: String? = nil) { self.audioStream = audioStream self.contentIdentificationType = contentIdentificationType self.enableChannelIdentification = enableChannelIdentification @@ -1119,7 +1117,6 @@ extension TranscribeStreaming { } public func validate(name: String) throws { - try self.audioStream.validate(name: "\(name).audioStream") try self.validate(self.mediaSampleRateHertz, name: "mediaSampleRateHertz", parent: name, max: 48000) try self.validate(self.mediaSampleRateHertz, name: "mediaSampleRateHertz", parent: name, min: 8000) try self.validate(self.numberOfChannels, name: "numberOfChannels", parent: name, min: 2) @@ -1135,6 +1132,7 @@ extension TranscribeStreaming { } public struct StartMedicalStreamTranscriptionResponse: AWSDecodableShape { + public static let _options: AWSShapeOptions = [.rawPayload] /// Shows whether content identification was enabled for your transcription. public let contentIdentificationType: MedicalContentIdentificationType? /// Shows whether channel identification was enabled for your transcription. @@ -1156,13 +1154,13 @@ extension TranscribeStreaming { /// Provides the medical specialty that you specified in your request. public let specialty: Specialty? /// Provides detailed information about your streaming session. - public let transcriptResultStream: MedicalTranscriptResultStream + public let transcriptResultStream: AWSEventStream /// Provides the type of audio you specified in your request. public let type: `Type`? /// Provides the name of the custom vocabulary that you specified in your request. public let vocabularyName: String? - public init(contentIdentificationType: MedicalContentIdentificationType? = nil, enableChannelIdentification: Bool? = nil, languageCode: LanguageCode? = nil, mediaEncoding: MediaEncoding? = nil, mediaSampleRateHertz: Int? = nil, numberOfChannels: Int? = nil, requestId: String? = nil, sessionId: String? = nil, showSpeakerLabel: Bool? = nil, specialty: Specialty? = nil, transcriptResultStream: MedicalTranscriptResultStream, type: `Type`? = nil, vocabularyName: String? = nil) { + public init(contentIdentificationType: MedicalContentIdentificationType? = nil, enableChannelIdentification: Bool? = nil, languageCode: LanguageCode? = nil, mediaEncoding: MediaEncoding? = nil, mediaSampleRateHertz: Int? = nil, numberOfChannels: Int? = nil, requestId: String? = nil, sessionId: String? = nil, showSpeakerLabel: Bool? = nil, specialty: Specialty? = nil, transcriptResultStream: AWSEventStream, type: `Type`? = nil, vocabularyName: String? = nil) { self.contentIdentificationType = contentIdentificationType self.enableChannelIdentification = enableChannelIdentification self.languageCode = languageCode @@ -1190,7 +1188,7 @@ extension TranscribeStreaming { self.sessionId = try response.decodeIfPresent(String.self, forHeader: "x-amzn-transcribe-session-id") self.showSpeakerLabel = try response.decodeIfPresent(Bool.self, forHeader: "x-amzn-transcribe-show-speaker-label") self.specialty = try response.decodeIfPresent(Specialty.self, forHeader: "x-amzn-transcribe-specialty") - self.transcriptResultStream = try .init(from: decoder) + self.transcriptResultStream = response.decodeEventStream() self.type = try response.decodeIfPresent(`Type`.self, forHeader: "x-amzn-transcribe-type") self.vocabularyName = try response.decodeIfPresent(String.self, forHeader: "x-amzn-transcribe-vocabulary-name") @@ -1228,7 +1226,7 @@ extension TranscribeStreaming { ] /// An encoded stream of audio blobs. Audio streams are encoded as either HTTP/2 or WebSocket data frames. For more information, see Transcribing streaming audio. - public let audioStream: AudioStream + public let audioStream: AWSEventStream /// Labels all personally identifiable information (PII) identified in your transcript. Content identification is performed at the segment level; PII specified in PiiEntityTypes is flagged upon complete transcription of an audio segment. You can’t set ContentIdentificationType and ContentRedactionType in the same request. If you set both, your request returns a BadRequestException. For more information, see Redacting or identifying personally identifiable information. public let contentIdentificationType: ContentIdentificationType? /// Redacts all personally identifiable information (PII) identified in your transcript. Content redaction is performed at the segment level; PII specified in PiiEntityTypes is redacted upon complete transcription of an audio segment. You can’t set ContentRedactionType and ContentIdentificationType in the same request. If you set both, your request returns a BadRequestException. For more information, see Redacting or identifying personally identifiable information. @@ -1272,7 +1270,7 @@ extension TranscribeStreaming { /// Specify the names of the custom vocabularies that you want to use when processing your transcription. Note that vocabulary names are case sensitive. If none of the languages of the specified custom vocabularies match the language identified in your media, your job fails. This parameter is only intended for use with the IdentifyLanguage parameter. If you're not including IdentifyLanguage in your request and want to use a custom vocabulary with your transcription, use the VocabularyName parameter instead. For more information, see Custom vocabularies. public let vocabularyNames: String? - public init(audioStream: AudioStream, contentIdentificationType: ContentIdentificationType? = nil, contentRedactionType: ContentRedactionType? = nil, enableChannelIdentification: Bool? = nil, enablePartialResultsStabilization: Bool? = nil, identifyLanguage: Bool? = nil, languageCode: LanguageCode? = nil, languageModelName: String? = nil, languageOptions: String? = nil, mediaEncoding: MediaEncoding, mediaSampleRateHertz: Int, numberOfChannels: Int? = nil, partialResultsStability: PartialResultsStability? = nil, piiEntityTypes: String? = nil, preferredLanguage: LanguageCode? = nil, sessionId: String? = nil, showSpeakerLabel: Bool? = nil, vocabularyFilterMethod: VocabularyFilterMethod? = nil, vocabularyFilterName: String? = nil, vocabularyFilterNames: String? = nil, vocabularyName: String? = nil, vocabularyNames: String? = nil) { + public init(audioStream: AWSEventStream, contentIdentificationType: ContentIdentificationType? = nil, contentRedactionType: ContentRedactionType? = nil, enableChannelIdentification: Bool? = nil, enablePartialResultsStabilization: Bool? = nil, identifyLanguage: Bool? = nil, languageCode: LanguageCode? = nil, languageModelName: String? = nil, languageOptions: String? = nil, mediaEncoding: MediaEncoding, mediaSampleRateHertz: Int, numberOfChannels: Int? = nil, partialResultsStability: PartialResultsStability? = nil, piiEntityTypes: String? = nil, preferredLanguage: LanguageCode? = nil, sessionId: String? = nil, showSpeakerLabel: Bool? = nil, vocabularyFilterMethod: VocabularyFilterMethod? = nil, vocabularyFilterName: String? = nil, vocabularyFilterNames: String? = nil, vocabularyName: String? = nil, vocabularyNames: String? = nil) { self.audioStream = audioStream self.contentIdentificationType = contentIdentificationType self.contentRedactionType = contentRedactionType @@ -1298,7 +1296,6 @@ extension TranscribeStreaming { } public func validate(name: String) throws { - try self.audioStream.validate(name: "\(name).audioStream") try self.validate(self.languageModelName, name: "languageModelName", parent: name, max: 200) try self.validate(self.languageModelName, name: "languageModelName", parent: name, min: 1) try self.validate(self.languageModelName, name: "languageModelName", parent: name, pattern: "^[0-9a-zA-Z._-]+$") @@ -1332,6 +1329,7 @@ extension TranscribeStreaming { } public struct StartStreamTranscriptionResponse: AWSDecodableShape { + public static let _options: AWSShapeOptions = [.rawPayload] /// Shows whether content identification was enabled for your transcription. public let contentIdentificationType: ContentIdentificationType? /// Shows whether content redaction was enabled for your transcription. @@ -1367,7 +1365,7 @@ extension TranscribeStreaming { /// Shows whether speaker partitioning was enabled for your transcription. public let showSpeakerLabel: Bool? /// Provides detailed information about your streaming session. - public let transcriptResultStream: TranscriptResultStream + public let transcriptResultStream: AWSEventStream /// Provides the vocabulary filtering method used in your transcription. public let vocabularyFilterMethod: VocabularyFilterMethod? /// Provides the name of the custom vocabulary filter that you specified in your request. @@ -1379,7 +1377,7 @@ extension TranscribeStreaming { /// Provides the names of the custom vocabularies that you specified in your request. public let vocabularyNames: String? - public init(contentIdentificationType: ContentIdentificationType? = nil, contentRedactionType: ContentRedactionType? = nil, enableChannelIdentification: Bool? = nil, enablePartialResultsStabilization: Bool? = nil, identifyLanguage: Bool? = nil, languageCode: LanguageCode? = nil, languageModelName: String? = nil, languageOptions: String? = nil, mediaEncoding: MediaEncoding? = nil, mediaSampleRateHertz: Int? = nil, numberOfChannels: Int? = nil, partialResultsStability: PartialResultsStability? = nil, piiEntityTypes: String? = nil, preferredLanguage: LanguageCode? = nil, requestId: String? = nil, sessionId: String? = nil, showSpeakerLabel: Bool? = nil, transcriptResultStream: TranscriptResultStream, vocabularyFilterMethod: VocabularyFilterMethod? = nil, vocabularyFilterName: String? = nil, vocabularyFilterNames: String? = nil, vocabularyName: String? = nil, vocabularyNames: String? = nil) { + public init(contentIdentificationType: ContentIdentificationType? = nil, contentRedactionType: ContentRedactionType? = nil, enableChannelIdentification: Bool? = nil, enablePartialResultsStabilization: Bool? = nil, identifyLanguage: Bool? = nil, languageCode: LanguageCode? = nil, languageModelName: String? = nil, languageOptions: String? = nil, mediaEncoding: MediaEncoding? = nil, mediaSampleRateHertz: Int? = nil, numberOfChannels: Int? = nil, partialResultsStability: PartialResultsStability? = nil, piiEntityTypes: String? = nil, preferredLanguage: LanguageCode? = nil, requestId: String? = nil, sessionId: String? = nil, showSpeakerLabel: Bool? = nil, transcriptResultStream: AWSEventStream, vocabularyFilterMethod: VocabularyFilterMethod? = nil, vocabularyFilterName: String? = nil, vocabularyFilterNames: String? = nil, vocabularyName: String? = nil, vocabularyNames: String? = nil) { self.contentIdentificationType = contentIdentificationType self.contentRedactionType = contentRedactionType self.enableChannelIdentification = enableChannelIdentification @@ -1424,7 +1422,7 @@ extension TranscribeStreaming { self.requestId = try response.decodeIfPresent(String.self, forHeader: "x-amzn-request-id") self.sessionId = try response.decodeIfPresent(String.self, forHeader: "x-amzn-transcribe-session-id") self.showSpeakerLabel = try response.decodeIfPresent(Bool.self, forHeader: "x-amzn-transcribe-show-speaker-label") - self.transcriptResultStream = try .init(from: decoder) + self.transcriptResultStream = response.decodeEventStream() self.vocabularyFilterMethod = try response.decodeIfPresent(VocabularyFilterMethod.self, forHeader: "x-amzn-transcribe-vocabulary-filter-method") self.vocabularyFilterName = try response.decodeIfPresent(String.self, forHeader: "x-amzn-transcribe-vocabulary-filter-name") self.vocabularyFilterNames = try response.decodeIfPresent(String.self, forHeader: "x-amzn-transcribe-vocabulary-filter-names") diff --git a/Sources/Soto/Services/WorkMailMessageFlow/WorkMailMessageFlow_shapes.swift b/Sources/Soto/Services/WorkMailMessageFlow/WorkMailMessageFlow_shapes.swift index 0a485dbd25..6449a05416 100644 --- a/Sources/Soto/Services/WorkMailMessageFlow/WorkMailMessageFlow_shapes.swift +++ b/Sources/Soto/Services/WorkMailMessageFlow/WorkMailMessageFlow_shapes.swift @@ -50,7 +50,7 @@ extension WorkMailMessageFlow { } public struct GetRawMessageContentResponse: AWSDecodableShape { - public static let _options: AWSShapeOptions = [.rawPayload, .allowStreaming] + public static let _options: AWSShapeOptions = [.rawPayload] /// The raw content of the email message, in MIME format. public let messageContent: AWSHTTPBody diff --git a/Tests/SotoTests/Services/Lambda/LambdaTests.swift b/Tests/SotoTests/Services/Lambda/LambdaTests.swift index 2d5514ebdc..2686326206 100644 --- a/Tests/SotoTests/Services/Lambda/LambdaTests.swift +++ b/Tests/SotoTests/Services/Lambda/LambdaTests.swift @@ -163,6 +163,24 @@ class LambdaTests: XCTestCase { XCTAssertEqual(payload, "\"hello world\"") } + func testInvokeWithEventStream() async throws { + // This doesnt work with LocalStack + guard !TestEnvironment.isUsingLocalstack else { return } + + // invoke the Lambda function created by setUp() + let request = Lambda.InvokeWithResponseStreamRequest(functionName: Self.functionName, logType: .tail, payload: .init(string: "{}")) + let response = try await Self.lambda.invokeWithResponseStream(request) + + for try await event in response.eventStream { + switch event { + case .payloadChunk(let update): + XCTAssertEqual(String(buffer: update.payload), "\"hello world\"") + case .invokeComplete(let complete): + print(complete) + } + } + } + func testListFunctions() async throws { _ = try await Self.lambda.listFunctions(.init(maxItems: 10)) } diff --git a/Tests/SotoTests/Services/S3/S3ExtensionTests.swift b/Tests/SotoTests/Services/S3/S3ExtensionTests.swift index 601c1bb2a1..aa63c88499 100644 --- a/Tests/SotoTests/Services/S3/S3ExtensionTests.swift +++ b/Tests/SotoTests/Services/S3/S3ExtensionTests.swift @@ -237,83 +237,68 @@ extension S3Tests { XCTAssertEqual(values3?.versionId, "5") } - /* - func testSelectObjectContent() throws { - // doesnt work with LocalStack - try XCTSkipIf(TestEnvironment.isUsingLocalstack) - - let s3 = Self.s3.with(timeout: .minutes(2)) - let strings = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.".split(separator: " ") - let file = strings.reduce("") { $0 + "\($1), \($1.count), \($0.count + $1.count)\n" } - let file2 = file + file - let file3 = file2 + file2 - let file4 = file3 + file3 - let file5 = file4 + file4 - let file6 = file5 + file5 - let file7 = file6 + file6 - let file8 = file7 + file7 - let file9 = file8 + file8 - let file10 = file9 + file9 - - let name = TestEnvironment.generateResourceName() - let runOnEventLoop = s3.client.eventLoopGroup.next() - - let response = S3Tests.createBucket(name: name, s3: s3) - .hop(to: runOnEventLoop) - .flatMap { _ -> EventLoopFuture in - let putRequest = S3.PutObjectRequest(body: .string(file10), bucket: name, key: "file.csv") - return s3.putObject(putRequest, on: runOnEventLoop) - } - .flatMap { _ -> EventLoopFuture in - let expression = "Select * from S3Object" - let input = S3.InputSerialization(csv: .init(fieldDelimiter: ",", fileHeaderInfo: .use, recordDelimiter: "\n")) - let output = S3.OutputSerialization(csv: .init(fieldDelimiter: ",", recordDelimiter: "\n")) - let request = S3.SelectObjectContentRequest( - bucket: name, - expression: expression, - expressionType: .sql, - inputSerialization: input, - key: "file.csv", - outputSerialization: output, - requestProgress: S3.RequestProgress(enabled: true) - ) - let size = file10.utf8.count - var returnedSize = 0 - return s3.selectObjectContentEventStream(request, logger: TestEnvironment.logger, on: runOnEventLoop) { eventStream, eventLoop in - XCTAssertTrue(eventLoop === runOnEventLoop) - switch eventStream { - case .records(let records): - if let payload = records.payload { - if let decodedCount = payload.decoded()?.count { - returnedSize += decodedCount - print("Record size: \(decodedCount)") - } else { - XCTFail("Failed to decode Base64 data in payload") - } - } - case .stats(let stats): - if let details = stats.details { - print("Stats: ") - print(" processed: \(details.bytesProcessed ?? 0)") - print(" returned: \(details.bytesReturned ?? 0)") - print(" scanned: \(details.bytesScanned ?? 0)") - - XCTAssertEqual(Int64(size), details.bytesProcessed) - XCTAssertEqual(Int64(returnedSize), details.bytesReturned) - } - case .end: - print("End") - default: - break - } - return eventLoop.makeSucceededFuture(()) - } - } - .flatAlways { _ in - return S3Tests.deleteBucket(name: name, s3: s3) - } - XCTAssertNoThrow(try response.wait()) - }*/ + func testSelectObjectContent() async throws { + // doesnt work with LocalStack + try XCTSkipIf(TestEnvironment.isUsingLocalstack) + + let s3 = Self.s3.with(timeout: .minutes(2)) + let strings = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.".split(separator: " ") + let file = strings.reduce("") { $0 + "\($1), \($1.count), \($0.count + $1.count)\n" } + let file2 = file + file + let file3 = file2 + file2 + let file4 = file3 + file3 + let file5 = file4 + file4 + let file6 = file5 + file5 + let file7 = file6 + file6 + let file8 = file7 + file7 + let file9 = file8 + file8 + let file10 = file9 + file9 + + let name = TestEnvironment.generateResourceName() + + try await testBucket(name) { name in + let putRequest = S3.PutObjectRequest(body: .init(string: file10), bucket: name, key: "file.csv") + _ = try await s3.putObject(putRequest, logger: TestEnvironment.logger) + + let expression = "Select * from S3Object" + let input = S3.InputSerialization(csv: .init(fieldDelimiter: ",", fileHeaderInfo: .use, recordDelimiter: "\n")) + let output = S3.OutputSerialization(csv: .init(fieldDelimiter: ",", recordDelimiter: "\n")) + let request = S3.SelectObjectContentRequest( + bucket: name, + expression: expression, + expressionType: .sql, + inputSerialization: input, + key: "file.csv", + outputSerialization: output, + requestProgress: S3.RequestProgress(enabled: true) + ) + let size = file10.utf8.count + var returnedSize = 0 + + let response = try await s3.selectObjectContent(request, logger: TestEnvironment.logger) + for try await event in response.payload { + switch event { + case .records(let records): + let decodedCount = records.payload.readableBytes + returnedSize += decodedCount + print("Record size: \(decodedCount)") + case .stats(let stats): + let details = stats.details + print("Stats: ") + print(" processed: \(details.bytesProcessed ?? 0)") + print(" returned: \(details.bytesReturned ?? 0)") + print(" scanned: \(details.bytesScanned ?? 0)") + + XCTAssertEqual(Int64(size), details.bytesProcessed) + XCTAssertEqual(Int64(returnedSize), details.bytesReturned) + case .end: + print("End") + default: + break + } + } + } + } func testS3VirtualAddressing(_ urlString: String, config: AWSServiceConfig = S3Tests.s3.config) throws -> String { let url = URL(string: urlString)!