diff --git a/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Error.swift b/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Error.swift index 55140be3ef1..412346f7019 100644 --- a/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Error.swift +++ b/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Error.swift @@ -5,12 +5,19 @@ // SPDX-License-Identifier: Apache-2.0 // -public struct Ec2Error: Decodable { - public let code: String - public let message: String +import SmithyReadWrite +import SmithyXML - enum CodingKeys: String, CodingKey { - case code = "Code" - case message = "Message" +public struct Ec2Error { + public var code: String? + public var message: String? + + static var readingClosure: ReadingClosure { + return { reader in + var value = Ec2Error() + value.code = try reader["Code"].readIfPresent() + value.message = try reader["Message"].readIfPresent() + return value + } } } diff --git a/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Errors.swift b/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Errors.swift index 7db4112a13a..55710cf4898 100644 --- a/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Errors.swift +++ b/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Errors.swift @@ -5,10 +5,17 @@ // SPDX-License-Identifier: Apache-2.0 // -public struct Ec2Errors: Decodable { - public let error: Ec2Error +import SmithyReadWrite +import SmithyXML - enum CodingKeys: String, CodingKey { - case error = "Error" +public struct Ec2Errors { + public var error: Ec2Error? + + static var readingClosure: ReadingClosure { + return { reader in + var value = Ec2Errors() + value.error = try reader["Error"].readIfPresent(readingClosure: Ec2Error.readingClosure) + return value + } } } diff --git a/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Response.swift b/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Response.swift index 464343c0c4f..245fac50d12 100644 --- a/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Response.swift +++ b/Sources/Core/AWSClientRuntime/Protocols/Ec2Query/Ec2Response.swift @@ -5,9 +5,13 @@ // SPDX-License-Identifier: Apache-2.0 // -public struct Ec2Response: Decodable { - public let errors: Ec2Errors - public let requestId: String +import SmithyReadWrite +import SmithyXML +@testable import ClientRuntime + +public struct Ec2Response { + public var errors: Ec2Errors? + public var requestId: String? enum CodingKeys: String, CodingKey { case errors = "Errors" @@ -15,13 +19,13 @@ public struct Ec2Response: Decodable { case requestID = "RequestID" } - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.errors = try container.decode(Ec2Errors.self, forKey: .errors) - - // Attempt to decode the requestId with the key "RequestID" - // if that is not present, then fallback to the key "RequestId" - self.requestId = try container.decodeIfPresent(String.self, forKey: .requestID) - ?? container.decode(String.self, forKey: .requestId) + public static var httpBinding: HTTPResponseOutputBinding { + return { httpResponse, responseReader in + let reader = responseReader + var value = Ec2Response() + value.errors = try reader["Errors"].readIfPresent(readingClosure: Ec2Errors.readingClosure) + value.requestId = try reader["RequestId"].readIfPresent() ?? reader["RequestID"].readIfPresent() + return value + } } } diff --git a/Sources/Core/AWSSDKForSwift/Documentation.docc/AWSSDKForSwift.md b/Sources/Core/AWSSDKForSwift/Documentation.docc/AWSSDKForSwift.md index 57420d81b25..074d4951f54 100644 --- a/Sources/Core/AWSSDKForSwift/Documentation.docc/AWSSDKForSwift.md +++ b/Sources/Core/AWSSDKForSwift/Documentation.docc/AWSSDKForSwift.md @@ -11,25 +11,751 @@ This SDK is open-source. Code is available on Github [here](https://github.com/ ## Service Documentation +[AWSACM](../../../../../swift/api/awsacm/latest) + +[AWSACMPCA](../../../../../swift/api/awsacmpca/latest) + +[AWSAPIGateway](../../../../../swift/api/awsapigateway/latest) + +[AWSARCZonalShift](../../../../../swift/api/awsarczonalshift/latest) + +[AWSAccessAnalyzer](../../../../../swift/api/awsaccessanalyzer/latest) + +[AWSAccount](../../../../../swift/api/awsaccount/latest) + +[AWSAlexaForBusiness](../../../../../swift/api/awsalexaforbusiness/latest) + +[AWSAmp](../../../../../swift/api/awsamp/latest) + +[AWSAmplify](../../../../../swift/api/awsamplify/latest) + +[AWSAmplifyBackend](../../../../../swift/api/awsamplifybackend/latest) + +[AWSAmplifyUIBuilder](../../../../../swift/api/awsamplifyuibuilder/latest) + +[AWSApiGatewayManagementApi](../../../../../swift/api/awsapigatewaymanagementapi/latest) + +[AWSApiGatewayV2](../../../../../swift/api/awsapigatewayv2/latest) + +[AWSAppConfig](../../../../../swift/api/awsappconfig/latest) + +[AWSAppConfigData](../../../../../swift/api/awsappconfigdata/latest) + +[AWSAppFabric](../../../../../swift/api/awsappfabric/latest) + +[AWSAppIntegrations](../../../../../swift/api/awsappintegrations/latest) + +[AWSAppMesh](../../../../../swift/api/awsappmesh/latest) + +[AWSAppRunner](../../../../../swift/api/awsapprunner/latest) + +[AWSAppStream](../../../../../swift/api/awsappstream/latest) + +[AWSAppSync](../../../../../swift/api/awsappsync/latest) + +[AWSAppflow](../../../../../swift/api/awsappflow/latest) + +[AWSApplicationAutoScaling](../../../../../swift/api/awsapplicationautoscaling/latest) + +[AWSApplicationCostProfiler](../../../../../swift/api/awsapplicationcostprofiler/latest) + +[AWSApplicationDiscoveryService](../../../../../swift/api/awsapplicationdiscoveryservice/latest) + +[AWSApplicationInsights](../../../../../swift/api/awsapplicationinsights/latest) + +[AWSAthena](../../../../../swift/api/awsathena/latest) + +[AWSAuditManager](../../../../../swift/api/awsauditmanager/latest) + +[AWSAutoScaling](../../../../../swift/api/awsautoscaling/latest) + +[AWSAutoScalingPlans](../../../../../swift/api/awsautoscalingplans/latest) + +[AWSB2bi](../../../../../swift/api/awsb2bi/latest) + +[AWSBCMDataExports](../../../../../swift/api/awsbcmdataexports/latest) + +[AWSBackup](../../../../../swift/api/awsbackup/latest) + +[AWSBackupGateway](../../../../../swift/api/awsbackupgateway/latest) + +[AWSBackupStorage](../../../../../swift/api/awsbackupstorage/latest) + +[AWSBatch](../../../../../swift/api/awsbatch/latest) + +[AWSBedrock](../../../../../swift/api/awsbedrock/latest) + +[AWSBedrockAgent](../../../../../swift/api/awsbedrockagent/latest) + +[AWSBedrockAgentRuntime](../../../../../swift/api/awsbedrockagentruntime/latest) + +[AWSBedrockRuntime](../../../../../swift/api/awsbedrockruntime/latest) + +[AWSBillingconductor](../../../../../swift/api/awsbillingconductor/latest) + +[AWSBraket](../../../../../swift/api/awsbraket/latest) + +[AWSBudgets](../../../../../swift/api/awsbudgets/latest) + +[AWSChime](../../../../../swift/api/awschime/latest) + +[AWSChimeSDKIdentity](../../../../../swift/api/awschimesdkidentity/latest) + +[AWSChimeSDKMediaPipelines](../../../../../swift/api/awschimesdkmediapipelines/latest) + +[AWSChimeSDKMeetings](../../../../../swift/api/awschimesdkmeetings/latest) + +[AWSChimeSDKMessaging](../../../../../swift/api/awschimesdkmessaging/latest) + +[AWSChimeSDKVoice](../../../../../swift/api/awschimesdkvoice/latest) + +[AWSCleanRooms](../../../../../swift/api/awscleanrooms/latest) + +[AWSCleanRoomsML](../../../../../swift/api/awscleanroomsml/latest) + +[AWSCloud9](../../../../../swift/api/awscloud9/latest) + +[AWSCloudControl](../../../../../swift/api/awscloudcontrol/latest) + +[AWSCloudDirectory](../../../../../swift/api/awsclouddirectory/latest) + +[AWSCloudFormation](../../../../../swift/api/awscloudformation/latest) + +[AWSCloudFront](../../../../../swift/api/awscloudfront/latest) + +[AWSCloudFrontKeyValueStore](../../../../../swift/api/awscloudfrontkeyvaluestore/latest) + +[AWSCloudHSM](../../../../../swift/api/awscloudhsm/latest) + +[AWSCloudHSMV2](../../../../../swift/api/awscloudhsmv2/latest) + +[AWSCloudSearch](../../../../../swift/api/awscloudsearch/latest) + +[AWSCloudSearchDomain](../../../../../swift/api/awscloudsearchdomain/latest) + +[AWSCloudTrail](../../../../../swift/api/awscloudtrail/latest) + +[AWSCloudTrailData](../../../../../swift/api/awscloudtraildata/latest) + +[AWSCloudWatch](../../../../../swift/api/awscloudwatch/latest) + +[AWSCloudWatchEvents](../../../../../swift/api/awscloudwatchevents/latest) + [AWSCloudWatchLogs](../../../../../swift/api/awscloudwatchlogs/latest) +[AWSCodeBuild](../../../../../swift/api/awscodebuild/latest) + +[AWSCodeCatalyst](../../../../../swift/api/awscodecatalyst/latest) + +[AWSCodeCommit](../../../../../swift/api/awscodecommit/latest) + +[AWSCodeDeploy](../../../../../swift/api/awscodedeploy/latest) + +[AWSCodeGuruProfiler](../../../../../swift/api/awscodeguruprofiler/latest) + +[AWSCodeGuruReviewer](../../../../../swift/api/awscodegurureviewer/latest) + +[AWSCodeGuruSecurity](../../../../../swift/api/awscodegurusecurity/latest) + +[AWSCodePipeline](../../../../../swift/api/awscodepipeline/latest) + +[AWSCodeStar](../../../../../swift/api/awscodestar/latest) + +[AWSCodeStarconnections](../../../../../swift/api/awscodestarconnections/latest) + +[AWSCodeartifact](../../../../../swift/api/awscodeartifact/latest) + +[AWSCodestarnotifications](../../../../../swift/api/awscodestarnotifications/latest) + +[AWSCognitoIdentity](../../../../../swift/api/awscognitoidentity/latest) + +[AWSCognitoIdentityProvider](../../../../../swift/api/awscognitoidentityprovider/latest) + +[AWSCognitoSync](../../../../../swift/api/awscognitosync/latest) + +[AWSComprehend](../../../../../swift/api/awscomprehend/latest) + +[AWSComprehendMedical](../../../../../swift/api/awscomprehendmedical/latest) + +[AWSComputeOptimizer](../../../../../swift/api/awscomputeoptimizer/latest) + +[AWSConfigService](../../../../../swift/api/awsconfigservice/latest) + +[AWSConnect](../../../../../swift/api/awsconnect/latest) + +[AWSConnectCampaigns](../../../../../swift/api/awsconnectcampaigns/latest) + +[AWSConnectCases](../../../../../swift/api/awsconnectcases/latest) + +[AWSConnectContactLens](../../../../../swift/api/awsconnectcontactlens/latest) + +[AWSConnectParticipant](../../../../../swift/api/awsconnectparticipant/latest) + +[AWSControlTower](../../../../../swift/api/awscontroltower/latest) + +[AWSCostExplorer](../../../../../swift/api/awscostexplorer/latest) + +[AWSCostOptimizationHub](../../../../../swift/api/awscostoptimizationhub/latest) + +[AWSCostandUsageReportService](../../../../../swift/api/awscostandusagereportservice/latest) + +[AWSCustomerProfiles](../../../../../swift/api/awscustomerprofiles/latest) + +[AWSDAX](../../../../../swift/api/awsdax/latest) + +[AWSDLM](../../../../../swift/api/awsdlm/latest) + +[AWSDataBrew](../../../../../swift/api/awsdatabrew/latest) + +[AWSDataExchange](../../../../../swift/api/awsdataexchange/latest) + +[AWSDataPipeline](../../../../../swift/api/awsdatapipeline/latest) + +[AWSDataSync](../../../../../swift/api/awsdatasync/latest) + +[AWSDataZone](../../../../../swift/api/awsdatazone/latest) + +[AWSDatabaseMigrationService](../../../../../swift/api/awsdatabasemigrationservice/latest) + +[AWSDetective](../../../../../swift/api/awsdetective/latest) + +[AWSDevOpsGuru](../../../../../swift/api/awsdevopsguru/latest) + +[AWSDeviceFarm](../../../../../swift/api/awsdevicefarm/latest) + +[AWSDirectConnect](../../../../../swift/api/awsdirectconnect/latest) + +[AWSDirectoryService](../../../../../swift/api/awsdirectoryservice/latest) + +[AWSDocDB](../../../../../swift/api/awsdocdb/latest) + +[AWSDocDBElastic](../../../../../swift/api/awsdocdbelastic/latest) + +[AWSDrs](../../../../../swift/api/awsdrs/latest) + +[AWSDynamoDB](../../../../../swift/api/awsdynamodb/latest) + +[AWSDynamoDBStreams](../../../../../swift/api/awsdynamodbstreams/latest) + +[AWSEBS](../../../../../swift/api/awsebs/latest) + [AWSEC2](../../../../../swift/api/awsec2/latest) +[AWSEC2InstanceConnect](../../../../../swift/api/awsec2instanceconnect/latest) + +[AWSECR](../../../../../swift/api/awsecr/latest) + +[AWSECRPUBLIC](../../../../../swift/api/awsecrpublic/latest) + [AWSECS](../../../../../swift/api/awsecs/latest) +[AWSEFS](../../../../../swift/api/awsefs/latest) + +[AWSEKS](../../../../../swift/api/awseks/latest) + +[AWSEKSAuth](../../../../../swift/api/awseksauth/latest) + +[AWSEMR](../../../../../swift/api/awsemr/latest) + +[AWSEMRServerless](../../../../../swift/api/awsemrserverless/latest) + +[AWSEMRcontainers](../../../../../swift/api/awsemrcontainers/latest) + +[AWSElastiCache](../../../../../swift/api/awselasticache/latest) + +[AWSElasticBeanstalk](../../../../../swift/api/awselasticbeanstalk/latest) + +[AWSElasticInference](../../../../../swift/api/awselasticinference/latest) + +[AWSElasticLoadBalancing](../../../../../swift/api/awselasticloadbalancing/latest) + +[AWSElasticLoadBalancingv2](../../../../../swift/api/awselasticloadbalancingv2/latest) + +[AWSElasticTranscoder](../../../../../swift/api/awselastictranscoder/latest) + +[AWSElasticsearchService](../../../../../swift/api/awselasticsearchservice/latest) + +[AWSEntityResolution](../../../../../swift/api/awsentityresolution/latest) + +[AWSEventBridge](../../../../../swift/api/awseventbridge/latest) + +[AWSEvidently](../../../../../swift/api/awsevidently/latest) + +[AWSFMS](../../../../../swift/api/awsfms/latest) + +[AWSFSx](../../../../../swift/api/awsfsx/latest) + +[AWSFinspace](../../../../../swift/api/awsfinspace/latest) + +[AWSFinspacedata](../../../../../swift/api/awsfinspacedata/latest) + +[AWSFirehose](../../../../../swift/api/awsfirehose/latest) + +[AWSFis](../../../../../swift/api/awsfis/latest) + +[AWSForecast](../../../../../swift/api/awsforecast/latest) + +[AWSForecastquery](../../../../../swift/api/awsforecastquery/latest) + +[AWSFraudDetector](../../../../../swift/api/awsfrauddetector/latest) + +[AWSFreeTier](../../../../../swift/api/awsfreetier/latest) + +[AWSGameLift](../../../../../swift/api/awsgamelift/latest) + +[AWSGlacier](../../../../../swift/api/awsglacier/latest) + +[AWSGlobalAccelerator](../../../../../swift/api/awsglobalaccelerator/latest) + +[AWSGlue](../../../../../swift/api/awsglue/latest) + +[AWSGrafana](../../../../../swift/api/awsgrafana/latest) + +[AWSGreengrass](../../../../../swift/api/awsgreengrass/latest) + +[AWSGreengrassV2](../../../../../swift/api/awsgreengrassv2/latest) + +[AWSGroundStation](../../../../../swift/api/awsgroundstation/latest) + +[AWSGuardDuty](../../../../../swift/api/awsguardduty/latest) + +[AWSHealth](../../../../../swift/api/awshealth/latest) + +[AWSHealthLake](../../../../../swift/api/awshealthlake/latest) + +[AWSHoneycode](../../../../../swift/api/awshoneycode/latest) + [AWSIAM](../../../../../swift/api/awsiam/latest) +[AWSIVSRealTime](../../../../../swift/api/awsivsrealtime/latest) + +[AWSIdentitystore](../../../../../swift/api/awsidentitystore/latest) + +[AWSImagebuilder](../../../../../swift/api/awsimagebuilder/latest) + +[AWSInspector](../../../../../swift/api/awsinspector/latest) + +[AWSInspector2](../../../../../swift/api/awsinspector2/latest) + +[AWSInspectorScan](../../../../../swift/api/awsinspectorscan/latest) + +[AWSInternetMonitor](../../../../../swift/api/awsinternetmonitor/latest) + +[AWSIoT](../../../../../swift/api/awsiot/latest) + +[AWSIoT1ClickDevicesService](../../../../../swift/api/awsiot1clickdevicesservice/latest) + +[AWSIoT1ClickProjects](../../../../../swift/api/awsiot1clickprojects/latest) + +[AWSIoTAnalytics](../../../../../swift/api/awsiotanalytics/latest) + +[AWSIoTDataPlane](../../../../../swift/api/awsiotdataplane/latest) + +[AWSIoTEvents](../../../../../swift/api/awsiotevents/latest) + +[AWSIoTEventsData](../../../../../swift/api/awsioteventsdata/latest) + +[AWSIoTFleetHub](../../../../../swift/api/awsiotfleethub/latest) + +[AWSIoTFleetWise](../../../../../swift/api/awsiotfleetwise/latest) + +[AWSIoTJobsDataPlane](../../../../../swift/api/awsiotjobsdataplane/latest) + +[AWSIoTRoboRunner](../../../../../swift/api/awsiotroborunner/latest) + +[AWSIoTSecureTunneling](../../../../../swift/api/awsiotsecuretunneling/latest) + +[AWSIoTSiteWise](../../../../../swift/api/awsiotsitewise/latest) + +[AWSIoTThingsGraph](../../../../../swift/api/awsiotthingsgraph/latest) + +[AWSIoTTwinMaker](../../../../../swift/api/awsiottwinmaker/latest) + +[AWSIoTWireless](../../../../../swift/api/awsiotwireless/latest) + +[AWSIotDeviceAdvisor](../../../../../swift/api/awsiotdeviceadvisor/latest) + +[AWSIvs](../../../../../swift/api/awsivs/latest) + +[AWSIvschat](../../../../../swift/api/awsivschat/latest) + +[AWSKMS](../../../../../swift/api/awskms/latest) + +[AWSKafka](../../../../../swift/api/awskafka/latest) + +[AWSKafkaConnect](../../../../../swift/api/awskafkaconnect/latest) + +[AWSKendra](../../../../../swift/api/awskendra/latest) + +[AWSKendraRanking](../../../../../swift/api/awskendraranking/latest) + +[AWSKeyspaces](../../../../../swift/api/awskeyspaces/latest) + [AWSKinesis](../../../../../swift/api/awskinesis/latest) +[AWSKinesisAnalytics](../../../../../swift/api/awskinesisanalytics/latest) + +[AWSKinesisAnalyticsV2](../../../../../swift/api/awskinesisanalyticsv2/latest) + +[AWSKinesisVideo](../../../../../swift/api/awskinesisvideo/latest) + +[AWSKinesisVideoArchivedMedia](../../../../../swift/api/awskinesisvideoarchivedmedia/latest) + +[AWSKinesisVideoMedia](../../../../../swift/api/awskinesisvideomedia/latest) + +[AWSKinesisVideoSignaling](../../../../../swift/api/awskinesisvideosignaling/latest) + +[AWSKinesisVideoWebRTCStorage](../../../../../swift/api/awskinesisvideowebrtcstorage/latest) + +[AWSLakeFormation](../../../../../swift/api/awslakeformation/latest) + +[AWSLambda](../../../../../swift/api/awslambda/latest) + +[AWSLaunchWizard](../../../../../swift/api/awslaunchwizard/latest) + +[AWSLexModelBuildingService](../../../../../swift/api/awslexmodelbuildingservice/latest) + +[AWSLexModelsV2](../../../../../swift/api/awslexmodelsv2/latest) + +[AWSLexRuntimeService](../../../../../swift/api/awslexruntimeservice/latest) + +[AWSLexRuntimeV2](../../../../../swift/api/awslexruntimev2/latest) + +[AWSLicenseManager](../../../../../swift/api/awslicensemanager/latest) + +[AWSLicenseManagerLinuxSubscriptions](../../../../../swift/api/awslicensemanagerlinuxsubscriptions/latest) + +[AWSLicenseManagerUserSubscriptions](../../../../../swift/api/awslicensemanagerusersubscriptions/latest) + +[AWSLightsail](../../../../../swift/api/awslightsail/latest) + +[AWSLocation](../../../../../swift/api/awslocation/latest) + +[AWSLookoutEquipment](../../../../../swift/api/awslookoutequipment/latest) + +[AWSLookoutMetrics](../../../../../swift/api/awslookoutmetrics/latest) + +[AWSLookoutVision](../../../../../swift/api/awslookoutvision/latest) + +[AWSM2](../../../../../swift/api/awsm2/latest) + +[AWSMTurk](../../../../../swift/api/awsmturk/latest) + +[AWSMWAA](../../../../../swift/api/awsmwaa/latest) + +[AWSMachineLearning](../../../../../swift/api/awsmachinelearning/latest) + +[AWSMacie2](../../../../../swift/api/awsmacie2/latest) + +[AWSManagedBlockchain](../../../../../swift/api/awsmanagedblockchain/latest) + +[AWSManagedBlockchainQuery](../../../../../swift/api/awsmanagedblockchainquery/latest) + +[AWSMarketplaceAgreement](../../../../../swift/api/awsmarketplaceagreement/latest) + +[AWSMarketplaceCatalog](../../../../../swift/api/awsmarketplacecatalog/latest) + +[AWSMarketplaceCommerceAnalytics](../../../../../swift/api/awsmarketplacecommerceanalytics/latest) + +[AWSMarketplaceDeployment](../../../../../swift/api/awsmarketplacedeployment/latest) + +[AWSMarketplaceEntitlementService](../../../../../swift/api/awsmarketplaceentitlementservice/latest) + +[AWSMarketplaceMetering](../../../../../swift/api/awsmarketplacemetering/latest) + +[AWSMediaConnect](../../../../../swift/api/awsmediaconnect/latest) + [AWSMediaConvert](../../../../../swift/api/awsmediaconvert/latest) +[AWSMediaLive](../../../../../swift/api/awsmedialive/latest) + +[AWSMediaPackage](../../../../../swift/api/awsmediapackage/latest) + +[AWSMediaPackageV2](../../../../../swift/api/awsmediapackagev2/latest) + +[AWSMediaPackageVod](../../../../../swift/api/awsmediapackagevod/latest) + +[AWSMediaStore](../../../../../swift/api/awsmediastore/latest) + +[AWSMediaStoreData](../../../../../swift/api/awsmediastoredata/latest) + +[AWSMediaTailor](../../../../../swift/api/awsmediatailor/latest) + +[AWSMedicalImaging](../../../../../swift/api/awsmedicalimaging/latest) + +[AWSMemoryDB](../../../../../swift/api/awsmemorydb/latest) + +[AWSMgn](../../../../../swift/api/awsmgn/latest) + +[AWSMigrationHub](../../../../../swift/api/awsmigrationhub/latest) + +[AWSMigrationHubConfig](../../../../../swift/api/awsmigrationhubconfig/latest) + +[AWSMigrationHubOrchestrator](../../../../../swift/api/awsmigrationhuborchestrator/latest) + +[AWSMigrationHubRefactorSpaces](../../../../../swift/api/awsmigrationhubrefactorspaces/latest) + +[AWSMigrationHubStrategy](../../../../../swift/api/awsmigrationhubstrategy/latest) + +[AWSMobile](../../../../../swift/api/awsmobile/latest) + +[AWSMq](../../../../../swift/api/awsmq/latest) + +[AWSNeptune](../../../../../swift/api/awsneptune/latest) + +[AWSNeptuneGraph](../../../../../swift/api/awsneptunegraph/latest) + +[AWSNeptunedata](../../../../../swift/api/awsneptunedata/latest) + +[AWSNetworkFirewall](../../../../../swift/api/awsnetworkfirewall/latest) + +[AWSNetworkManager](../../../../../swift/api/awsnetworkmanager/latest) + +[AWSNimble](../../../../../swift/api/awsnimble/latest) + +[AWSOAM](../../../../../swift/api/awsoam/latest) + +[AWSOSIS](../../../../../swift/api/awsosis/latest) + +[AWSOmics](../../../../../swift/api/awsomics/latest) + +[AWSOpenSearch](../../../../../swift/api/awsopensearch/latest) + +[AWSOpenSearchServerless](../../../../../swift/api/awsopensearchserverless/latest) + +[AWSOpsWorks](../../../../../swift/api/awsopsworks/latest) + +[AWSOpsWorksCM](../../../../../swift/api/awsopsworkscm/latest) + +[AWSOrganizations](../../../../../swift/api/awsorganizations/latest) + +[AWSOutposts](../../../../../swift/api/awsoutposts/latest) + +[AWSPI](../../../../../swift/api/awspi/latest) + +[AWSPanorama](../../../../../swift/api/awspanorama/latest) + +[AWSPaymentCryptography](../../../../../swift/api/awspaymentcryptography/latest) + +[AWSPaymentCryptographyData](../../../../../swift/api/awspaymentcryptographydata/latest) + +[AWSPcaConnectorAd](../../../../../swift/api/awspcaconnectorad/latest) + +[AWSPersonalize](../../../../../swift/api/awspersonalize/latest) + +[AWSPersonalizeEvents](../../../../../swift/api/awspersonalizeevents/latest) + +[AWSPersonalizeRuntime](../../../../../swift/api/awspersonalizeruntime/latest) + +[AWSPinpoint](../../../../../swift/api/awspinpoint/latest) + +[AWSPinpointEmail](../../../../../swift/api/awspinpointemail/latest) + +[AWSPinpointSMSVoice](../../../../../swift/api/awspinpointsmsvoice/latest) + +[AWSPinpointSMSVoiceV2](../../../../../swift/api/awspinpointsmsvoicev2/latest) + +[AWSPipes](../../../../../swift/api/awspipes/latest) + +[AWSPolly](../../../../../swift/api/awspolly/latest) + +[AWSPricing](../../../../../swift/api/awspricing/latest) + +[AWSPrivateNetworks](../../../../../swift/api/awsprivatenetworks/latest) + +[AWSProton](../../../../../swift/api/awsproton/latest) + +[AWSQBusiness](../../../../../swift/api/awsqbusiness/latest) + +[AWSQConnect](../../../../../swift/api/awsqconnect/latest) + +[AWSQLDB](../../../../../swift/api/awsqldb/latest) + +[AWSQLDBSession](../../../../../swift/api/awsqldbsession/latest) + +[AWSQuickSight](../../../../../swift/api/awsquicksight/latest) + +[AWSRAM](../../../../../swift/api/awsram/latest) + +[AWSRDS](../../../../../swift/api/awsrds/latest) + +[AWSRDSData](../../../../../swift/api/awsrdsdata/latest) + +[AWSRUM](../../../../../swift/api/awsrum/latest) + +[AWSRbin](../../../../../swift/api/awsrbin/latest) + +[AWSRedshift](../../../../../swift/api/awsredshift/latest) + +[AWSRedshiftData](../../../../../swift/api/awsredshiftdata/latest) + +[AWSRedshiftServerless](../../../../../swift/api/awsredshiftserverless/latest) + +[AWSRekognition](../../../../../swift/api/awsrekognition/latest) + +[AWSRepostspace](../../../../../swift/api/awsrepostspace/latest) + +[AWSResiliencehub](../../../../../swift/api/awsresiliencehub/latest) + +[AWSResourceExplorer2](../../../../../swift/api/awsresourceexplorer2/latest) + +[AWSResourceGroups](../../../../../swift/api/awsresourcegroups/latest) + +[AWSResourceGroupsTaggingAPI](../../../../../swift/api/awsresourcegroupstaggingapi/latest) + +[AWSRoboMaker](../../../../../swift/api/awsrobomaker/latest) + +[AWSRolesAnywhere](../../../../../swift/api/awsrolesanywhere/latest) + +[AWSRoute53](../../../../../swift/api/awsroute53/latest) + +[AWSRoute53Domains](../../../../../swift/api/awsroute53domains/latest) + +[AWSRoute53RecoveryCluster](../../../../../swift/api/awsroute53recoverycluster/latest) + +[AWSRoute53RecoveryControlConfig](../../../../../swift/api/awsroute53recoverycontrolconfig/latest) + +[AWSRoute53RecoveryReadiness](../../../../../swift/api/awsroute53recoveryreadiness/latest) + +[AWSRoute53Resolver](../../../../../swift/api/awsroute53resolver/latest) + [AWSS3](../../../../../swift/api/awss3/latest) +[AWSS3Control](../../../../../swift/api/awss3control/latest) + +[AWSS3Outposts](../../../../../swift/api/awss3outposts/latest) + +[AWSSES](../../../../../swift/api/awsses/latest) + +[AWSSESv2](../../../../../swift/api/awssesv2/latest) + +[AWSSFN](../../../../../swift/api/awssfn/latest) + +[AWSSMS](../../../../../swift/api/awssms/latest) + +[AWSSNS](../../../../../swift/api/awssns/latest) + [AWSSQS](../../../../../swift/api/awssqs/latest) +[AWSSSM](../../../../../swift/api/awsssm/latest) + +[AWSSSMContacts](../../../../../swift/api/awsssmcontacts/latest) + +[AWSSSMIncidents](../../../../../swift/api/awsssmincidents/latest) + +[AWSSSO](../../../../../swift/api/awssso/latest) + [AWSSSOAdmin](../../../../../swift/api/awsssoadmin/latest) +[AWSSSOOIDC](../../../../../swift/api/awsssooidc/latest) + [AWSSTS](../../../../../swift/api/awssts/latest) +[AWSSWF](../../../../../swift/api/awsswf/latest) + +[AWSSageMaker](../../../../../swift/api/awssagemaker/latest) + +[AWSSageMakerA2IRuntime](../../../../../swift/api/awssagemakera2iruntime/latest) + +[AWSSageMakerFeatureStoreRuntime](../../../../../swift/api/awssagemakerfeaturestoreruntime/latest) + +[AWSSageMakerGeospatial](../../../../../swift/api/awssagemakergeospatial/latest) + +[AWSSageMakerMetrics](../../../../../swift/api/awssagemakermetrics/latest) + +[AWSSageMakerRuntime](../../../../../swift/api/awssagemakerruntime/latest) + +[AWSSagemakerEdge](../../../../../swift/api/awssagemakeredge/latest) + +[AWSSavingsplans](../../../../../swift/api/awssavingsplans/latest) + +[AWSScheduler](../../../../../swift/api/awsscheduler/latest) + +[AWSSchemas](../../../../../swift/api/awsschemas/latest) + +[AWSSecretsManager](../../../../../swift/api/awssecretsmanager/latest) + +[AWSSecurityHub](../../../../../swift/api/awssecurityhub/latest) + +[AWSSecurityLake](../../../../../swift/api/awssecuritylake/latest) + +[AWSServerlessApplicationRepository](../../../../../swift/api/awsserverlessapplicationrepository/latest) + +[AWSServiceCatalog](../../../../../swift/api/awsservicecatalog/latest) + +[AWSServiceCatalogAppRegistry](../../../../../swift/api/awsservicecatalogappregistry/latest) + +[AWSServiceDiscovery](../../../../../swift/api/awsservicediscovery/latest) + +[AWSServiceQuotas](../../../../../swift/api/awsservicequotas/latest) + +[AWSShield](../../../../../swift/api/awsshield/latest) + +[AWSSigner](../../../../../swift/api/awssigner/latest) + +[AWSSimSpaceWeaver](../../../../../swift/api/awssimspaceweaver/latest) + +[AWSSnowDeviceManagement](../../../../../swift/api/awssnowdevicemanagement/latest) + +[AWSSnowball](../../../../../swift/api/awssnowball/latest) + +[AWSSsmSap](../../../../../swift/api/awsssmsap/latest) + +[AWSStorageGateway](../../../../../swift/api/awsstoragegateway/latest) + +[AWSSupport](../../../../../swift/api/awssupport/latest) + +[AWSSupportApp](../../../../../swift/api/awssupportapp/latest) + +[AWSSynthetics](../../../../../swift/api/awssynthetics/latest) + +[AWSTextract](../../../../../swift/api/awstextract/latest) + +[AWSTimestreamQuery](../../../../../swift/api/awstimestreamquery/latest) + +[AWSTimestreamWrite](../../../../../swift/api/awstimestreamwrite/latest) + +[AWSTnb](../../../../../swift/api/awstnb/latest) + +[AWSTranscribe](../../../../../swift/api/awstranscribe/latest) + +[AWSTranscribeStreaming](../../../../../swift/api/awstranscribestreaming/latest) + +[AWSTransfer](../../../../../swift/api/awstransfer/latest) + [AWSTranslate](../../../../../swift/api/awstranslate/latest) +[AWSTrustedAdvisor](../../../../../swift/api/awstrustedadvisor/latest) + +[AWSVPCLattice](../../../../../swift/api/awsvpclattice/latest) + +[AWSVerifiedPermissions](../../../../../swift/api/awsverifiedpermissions/latest) + +[AWSVoiceID](../../../../../swift/api/awsvoiceid/latest) + +[AWSWAF](../../../../../swift/api/awswaf/latest) + +[AWSWAFRegional](../../../../../swift/api/awswafregional/latest) + +[AWSWAFV2](../../../../../swift/api/awswafv2/latest) + +[AWSWellArchitected](../../../../../swift/api/awswellarchitected/latest) + +[AWSWisdom](../../../../../swift/api/awswisdom/latest) + +[AWSWorkDocs](../../../../../swift/api/awsworkdocs/latest) + +[AWSWorkLink](../../../../../swift/api/awsworklink/latest) + +[AWSWorkMail](../../../../../swift/api/awsworkmail/latest) + +[AWSWorkMailMessageFlow](../../../../../swift/api/awsworkmailmessageflow/latest) + +[AWSWorkSpaces](../../../../../swift/api/awsworkspaces/latest) + +[AWSWorkSpacesThinClient](../../../../../swift/api/awsworkspacesthinclient/latest) + +[AWSWorkSpacesWeb](../../../../../swift/api/awsworkspacesweb/latest) + +[AWSXRay](../../../../../swift/api/awsxray/latest) + diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/Ec2Query/Ec2ErrorRequestIdTests.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/Ec2Query/Ec2ErrorRequestIdTests.swift index 22f1792ea64..2b85bd96e4e 100644 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/Ec2Query/Ec2ErrorRequestIdTests.swift +++ b/Tests/Core/AWSClientRuntimeTests/Protocols/Ec2Query/Ec2ErrorRequestIdTests.swift @@ -9,12 +9,13 @@ import ClientRuntime import SmithyTestUtil import XCTest +import SmithyXML @testable import AWSClientRuntime class Ec2ErrorRequestIdTests: XCTestCase { - func testEc2ResponseDecodesRequestID() throws { - let data = """ + func testEc2ResponseDecodesRequestID() async throws { + let data = Data(""" @@ -24,13 +25,14 @@ class Ec2ErrorRequestIdTests: XCTestCase { abcdefg12345 - """.data(using: .utf8)! - let response = try XMLDecoder().decode(Ec2Response.self, from: data) + """.utf8) + let httpResponse = HttpResponse(body: .data(data), statusCode: .ok) + let response = try await responseClosure(Ec2Response.httpBinding, responseDocumentBinding())(httpResponse) XCTAssertEqual(response.requestId, "abcdefg12345") } - func testEc2ResponseDecodesRequestId() throws { - let data = """ + func testEc2ResponseDecodesRequestId() async throws { + let data = Data(""" @@ -40,34 +42,37 @@ class Ec2ErrorRequestIdTests: XCTestCase { abcdefg12345 - """.data(using: .utf8)! - let response = try XMLDecoder().decode(Ec2Response.self, from: data) + """.utf8) + let httpResponse = HttpResponse(body: .data(data), statusCode: .ok) + let response = try await responseClosure(Ec2Response.httpBinding, responseDocumentBinding())(httpResponse) XCTAssertEqual(response.requestId, "abcdefg12345") } - func testEc2NarrowedResponseDecodesRequestID() throws { - let data = """ + func testEc2NarrowedResponseDecodesRequestID() async throws { + let data = Data(""" Sample Error abcdefg12345 - """.data(using: .utf8)! - let response = try XMLDecoder().decode(Ec2NarrowedResponse.self, from: data) + """.utf8) + let httpResponse = HttpResponse(body: .data(data), statusCode: .ok) + let response = try await responseClosure(Ec2Response.httpBinding, responseDocumentBinding())(httpResponse) XCTAssertEqual(response.requestId, "abcdefg12345") } - func testEc2NarrowResponseDecodesRequestId() throws { - let data = """ + func testEc2NarrowResponseDecodesRequestId() async throws { + let data = Data(""" Sample Error abcdefg12345 - """.data(using: .utf8)! - let response = try XMLDecoder().decode(Ec2NarrowedResponse.self, from: data) + """.utf8) + let httpResponse = HttpResponse(body: .data(data), statusCode: .ok) + let response = try await responseClosure(Ec2Response.httpBinding, responseDocumentBinding())(httpResponse) XCTAssertEqual(response.requestId, "abcdefg12345") } } diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLError+ResponseInit.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLError+ResponseInit.swift deleted file mode 100644 index 7230ce6e722..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLError+ResponseInit.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Code generated by smithy-swift-codegen. DO NOT EDIT! - -import AWSClientRuntime -import ClientRuntime - -extension ComplexXMLError { - public init (httpResponse: HttpResponse, decoder: ResponseDecoder? = nil, message: String? = nil, requestID: String? = nil) async throws { - if let headerHeaderValue = httpResponse.headers.value(for: "X-Header") { - self.header = headerHeaderValue - } else { - self.header = nil - } - - if let data = try await httpResponse.body.readData(), let responseDecoder = decoder { - let output: ErrorResponseContainer = try responseDecoder.decode(responseBody: data) - self.nested = output.error.nested - self.topLevel = output.error.topLevel - } else { - self.nested = nil - self.topLevel = nil - } - self.httpResponse = httpResponse - self.requestID = requestID - self.message = message - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLError.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLError.swift deleted file mode 100644 index 1f0ef96c1ef..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLError.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Code generated by smithy-swift-codegen. DO NOT EDIT! -import AWSClientRuntime -import ClientRuntime - -public struct ComplexXMLError: AWSServiceError, HTTPError, Error { - public var typeName: String? - public var message: String? - public var requestID: String? - public var header: String? - public var nested: ComplexXMLNestedErrorData? - public var topLevel: String? - public var httpResponse = HttpResponse() - - public init ( - header: String? = nil, - nested: ComplexXMLNestedErrorData? = nil, - topLevel: String? = nil - ) - { - self.header = header - self.nested = nested - self.topLevel = topLevel - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorBody+Decodable.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorBody+Decodable.swift deleted file mode 100644 index 11fc83101a7..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorBody+Decodable.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Code generated by smithy-swift-codegen. DO NOT EDIT! -import ClientRuntime - -struct ComplexXMLErrorBody: Equatable { - public let topLevel: String? - public let nested: ComplexXMLNestedErrorData? -} -extension ComplexXMLErrorBody: Decodable { - enum CodingKeys: String, CodingKey { - case nested = "Nested" - case topLevel = "TopLevel" - } - - public init (from decoder: Decoder) throws { - let containerValues = try decoder.container(keyedBy: CodingKeys.self) - let topLevelDecoded = try containerValues.decodeIfPresent(String.self, forKey: .topLevel) - topLevel = topLevelDecoded - let nestedDecoded = try containerValues.decodeIfPresent(ComplexXMLNestedErrorData.self, forKey: .nested) - nested = nestedDecoded - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorNoErrorWrapping+Init.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorNoErrorWrapping+Init.swift deleted file mode 100644 index dce5308ed90..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorNoErrorWrapping+Init.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Code generated by smithy-swift-codegen. DO NOT EDIT! - -import AWSClientRuntime -import ClientRuntime - -extension ComplexXMLErrorNoErrorWrapping { - public init (httpResponse: HttpResponse, decoder: ResponseDecoder? = nil, message: String? = nil, requestID: String? = nil) async throws { - if let headerHeaderValue = httpResponse.headers.value(for: "X-Header") { - self.header = headerHeaderValue - } else { - self.header = nil - } - if let data = try await httpResponse.body.readData(), let responseDecoder = decoder { - let output: ComplexXMLErrorNoErrorWrappingBody = try responseDecoder.decode(responseBody: data) - self.nested = output.nested - self.topLevel = output.topLevel - } else { - self.nested = nil - self.topLevel = nil - } - self.httpResponse = httpResponse - self.requestID = requestID - self.message = message - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorNoErrorWrapping.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorNoErrorWrapping.swift deleted file mode 100644 index 5612f0553ff..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorNoErrorWrapping.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -import AWSClientRuntime -import ClientRuntime - -public struct ComplexXMLErrorNoErrorWrapping: AWSServiceError, HTTPError, Error { - public var typeName: String? - public var message: String? - public var httpResponse = HttpResponse() - public var requestID: String? - public var header: String? - public var nested: ComplexXMLNestedErrorData? - public var topLevel: String? - - public init ( - header: String? = nil, - nested: ComplexXMLNestedErrorData? = nil, - topLevel: String? = nil - ) - { - self.header = header - self.nested = nested - self.topLevel = topLevel - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorNoErrorWrappingBody+Decodable.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorNoErrorWrappingBody+Decodable.swift deleted file mode 100644 index e895ae65565..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLErrorNoErrorWrappingBody+Decodable.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Code generated by smithy-swift-codegen. DO NOT EDIT! - -import ClientRuntime - -struct ComplexXMLErrorNoErrorWrappingBody: Equatable { - public let topLevel: String? - public let nested: ComplexXMLNestedErrorData? -} - -extension ComplexXMLErrorNoErrorWrappingBody: Decodable { - enum CodingKeys: String, CodingKey { - case nested = "Nested" - case topLevel = "TopLevel" - } - - public init (from decoder: Decoder) throws { - let containerValues = try decoder.container(keyedBy: CodingKeys.self) - let topLevelDecoded = try containerValues.decodeIfPresent(String.self, forKey: .topLevel) - topLevel = topLevelDecoded - let nestedDecoded = try containerValues.decodeIfPresent(ComplexXMLNestedErrorData.self, forKey: .nested) - nested = nestedDecoded - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLNestedErrorData+Codable.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLNestedErrorData+Codable.swift deleted file mode 100644 index 05046a73c6d..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLNestedErrorData+Codable.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Code generated by smithy-swift-codegen. DO NOT EDIT! - -import ClientRuntime - -extension ComplexXMLNestedErrorData: Codable { - enum CodingKeys: String, CodingKey { - case foo = "Foo" - } - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: Key.self) - if let foo = foo { - try container.encode(foo, forKey: Key("foo")) - } - } - - public init (from decoder: Decoder) throws { - let containerValues = try decoder.container(keyedBy: CodingKeys.self) - let fooDecoded = try containerValues.decodeIfPresent(String.self, forKey: .foo) - foo = fooDecoded - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLNestedErrorData.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLNestedErrorData.swift deleted file mode 100644 index 53b390cd5af..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/ComplexXMLNestedErrorData.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Code generated by smithy-swift-codegen. DO NOT EDIT! - -public struct ComplexXMLNestedErrorData: Equatable { - public let foo: String? - - public init ( - foo: String? = nil - ) - { - self.foo = foo - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/GreetingWithErrorsNoErrorWrappingOutputError+HttpResponseBinding.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/GreetingWithErrorsNoErrorWrappingOutputError+HttpResponseBinding.swift deleted file mode 100644 index 304e9ad28b3..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/GreetingWithErrorsNoErrorWrappingOutputError+HttpResponseBinding.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Code generated by smithy-swift-codegen. DO NOT EDIT! - -import AWSClientRuntime -import ClientRuntime - -public enum GreetingWithErrorsNoErrorWrappingOutputError: HttpResponseErrorBinding { - public static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder?) async throws -> Error { - let errorDetails = try await RestXMLError(httpResponse: httpResponse) - switch errorDetails.errorCode { - case "ComplexXMLErrorNoErrorWrapping": return try await ComplexXMLErrorNoErrorWrapping(httpResponse: httpResponse, decoder: decoder, message: errorDetails.message, requestID: errorDetails.requestId) - default: return UnknownAWSHTTPServiceError(httpResponse: httpResponse, message: errorDetails.message, requestID: errorDetails.requestId, typeName: errorDetails.errorCode) - } - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/GreetingWithErrorsOutputError+ResponseInit.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/GreetingWithErrorsOutputError+ResponseInit.swift deleted file mode 100644 index d0e65bf8e62..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/GreetingWithErrorsOutputError+ResponseInit.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -import AWSClientRuntime -import ClientRuntime - -public enum GreetingWithErrorsOutputError: HttpResponseErrorBinding { - public static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder?) async throws -> Error { - let errorDetails = try await RestXMLError(httpResponse: httpResponse) - switch errorDetails.errorCode { - case "ComplexXMLError": return try await ComplexXMLError(httpResponse: httpResponse, decoder: decoder, message: errorDetails.message, requestID: errorDetails.requestId) - case "InvalidGreeting": return try await InvalidGreeting(httpResponse: httpResponse, decoder: decoder, message: errorDetails.message, requestID: errorDetails.requestId) - default: return UnknownAWSHTTPServiceError(httpResponse: httpResponse, message: errorDetails.message, requestID: errorDetails.requestId, typeName: errorDetails.errorCode) - } - } -} - diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/InvalidGreeting+ResponseInit.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/InvalidGreeting+ResponseInit.swift deleted file mode 100644 index 83c90e5c6df..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/InvalidGreeting+ResponseInit.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Code generated by smithy-swift-codegen. DO NOT EDIT! - -import AWSClientRuntime -import ClientRuntime - -extension InvalidGreeting { - public init(httpResponse: HttpResponse, decoder: ResponseDecoder? = nil, message: String? = nil, requestID: String? = nil) async throws { - - if let data = try await httpResponse.body.readData(), let responseDecoder = decoder { - let output: InvalidGreetingBody = try responseDecoder.decode(responseBody: data) - self.message = output.message - } else { - self.message = nil - } - self.httpResponse = httpResponse - self.requestID = requestID - self.message = message - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/InvalidGreeting.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/InvalidGreeting.swift deleted file mode 100644 index 3860141dffd..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/InvalidGreeting.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Code generated by smithy-swift-codegen. DO NOT EDIT! - -import AWSClientRuntime -import ClientRuntime - -public struct InvalidGreeting: AWSServiceError, HTTPError, Error { - public var typeName: String? - public var httpResponse = HttpResponse() - public var requestID: String? - public var message: String? - - public init ( - message: String? = nil - ) - { - self.message = message - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/InvalidGreetingBody+Decodable.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/InvalidGreetingBody+Decodable.swift deleted file mode 100644 index d57ab9560ca..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/Models/Errors/InvalidGreetingBody+Decodable.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - -// Code generated by smithy-swift-codegen. DO NOT EDIT! - -import ClientRuntime - -struct InvalidGreetingBody: Equatable { - public let message: String? -} - -extension InvalidGreetingBody: Decodable { - enum CodingKeys: String, CodingKey { - case message = "Message" - } - - public init (from decoder: Decoder) throws { - let containerValues = try decoder.container(keyedBy: Key.self) - let errorContainer = try containerValues.nestedContainer(keyedBy: CodingKeys.self, forKey: Key("Error")) - - let messageDecoded = try errorContainer.decodeIfPresent(String.self, forKey: .message) - message = messageDecoded - } -} diff --git a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/RestXMLErrorTests.swift b/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/RestXMLErrorTests.swift deleted file mode 100644 index 6bf07cffd20..00000000000 --- a/Tests/Core/AWSClientRuntimeTests/Protocols/RestXML/RestXMLErrorTests.swift +++ /dev/null @@ -1,202 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// - - -import ClientRuntime -import SmithyTestUtil -import XCTest -@testable import AWSClientRuntime - -class RestXMLErrorTests: HttpResponseTestBase { - let host = "my-api.us-east-2.amazonaws.com" - - func testInvalidGreetingError() async { - do { - guard let httpResponse = buildHttpResponse( - code: 400, - headers: [ - "Content-Type": "application/xml" - ], - content: ByteStream.data(""" - - - Sender - InvalidGreeting - Hi - setting - - foo-id - - - """.data(using: .utf8)!) - ) else { - XCTFail("Something is wrong with the created http response") - return - } - - let decoder = JSONDecoder() - let greetingWithErrorsOutputError = try await GreetingWithErrorsOutputError.makeError(httpResponse: httpResponse, decoder: decoder) - - if let actual = greetingWithErrorsOutputError as? InvalidGreeting { - - let expected = InvalidGreeting( - message: "Hi" - ) - XCTAssertEqual(actual.httpResponse.statusCode, HttpStatusCode(rawValue: 400)) - XCTAssertEqual(expected.message, actual.message) - XCTAssertEqual("foo-id", actual.requestID) - } else { - XCTFail("The deserialized error type does not match expected type") - } - - } catch let err { - XCTFail(err.localizedDescription) - } - } - - func testComplexError() async { - do { - guard let httpResponse = buildHttpResponse( - code: 400, - headers: [ - "Content-Type": "application/xml", - "X-Header": "Header" - ], - content: ByteStream.data(""" - - - Sender - ComplexXMLError - Hi - Top level - - bar - - - foo-id - - - """.data(using: .utf8)!) - ) else { - XCTFail("Something is wrong with the created http response") - return - } - - let decoder = JSONDecoder() - let greetingWithErrorsOutputError = try await GreetingWithErrorsOutputError.makeError(httpResponse: httpResponse, decoder: decoder) - - if let actual = greetingWithErrorsOutputError as? ComplexXMLError { - - let expected = ComplexXMLError( - header: "Header", - nested: ComplexXMLNestedErrorData( - foo: "bar" - ), - topLevel: "Top level" - ) - XCTAssertEqual(actual.httpResponse.statusCode, HttpStatusCode(rawValue: 400)) - XCTAssertEqual(expected.header, actual.header) - XCTAssertEqual(expected.topLevel, actual.topLevel) - XCTAssertEqual(expected.nested, actual.nested) - XCTAssertEqual("Hi", actual.message) - XCTAssertEqual("foo-id", actual.requestID) - } else { - XCTFail("The deserialized error type does not match expected type") - } - - } catch let err { - XCTFail(err.localizedDescription) - } - } - - func testComplexErrorWithNoErrorWrapping() async { - do { - guard let httpResponse = buildHttpResponse( - code: 400, - headers: [ - "Content-Type": "application/xml", - "X-Header": "Header" - ], - content: ByteStream.data(""" - - Sender - ComplexXMLErrorNoErrorWrapping - Hi - Top level - - bar - - foo-id - - """.data(using: .utf8)!) - ) else { - XCTFail("Something is wrong with the created http response") - return - } - - let decoder = JSONDecoder() - let greetingWithErrorsOutputError = try await GreetingWithErrorsNoErrorWrappingOutputError.makeError(httpResponse: httpResponse, decoder: decoder) - - if let actual = greetingWithErrorsOutputError as? ComplexXMLErrorNoErrorWrapping { - - let expected = ComplexXMLErrorNoErrorWrapping( - header: "Header", - nested: ComplexXMLNestedErrorData( - foo: "bar" - ), - topLevel: "Top level" - ) - XCTAssertEqual(actual.httpResponse.statusCode, HttpStatusCode(rawValue: 400)) - XCTAssertEqual(expected.header, actual.header) - XCTAssertEqual(expected.topLevel, actual.topLevel) - XCTAssertEqual(expected.nested, actual.nested) - XCTAssertEqual("Hi", actual.message) - XCTAssertEqual("foo-id", actual.requestID) - } else { - XCTFail("The deserialized error type does not match expected type") - } - - } catch let err { - XCTFail(err.localizedDescription) - } - } - - func testUnhandledAccessDeniedErrors() async { - do { - guard let httpResponse = buildHttpResponse( - code: 403, - headers: [ - "Content-Type": "application/xml", - "X-Header": "Header" - ], - content: ByteStream.data(""" - - - AccessDenied - Access Denied - abcdefg123456 - 987654321abcdefg - - """.data(using: .utf8)!) - ) else { - XCTFail("Something is wrong with the created http response") - return - } - - let decoder = JSONDecoder() - let greetingWithErrorsOutputError = try await GreetingWithErrorsOutputError.makeError(httpResponse: httpResponse, decoder: decoder) - if let actual = greetingWithErrorsOutputError as? UnknownAWSHTTPServiceError { - XCTAssertEqual("Access Denied", actual.message) - XCTAssertEqual("abcdefg123456", actual.requestID) - } else { - XCTFail("The deserialized error type does not match expected type") - } - } catch let err { - XCTFail(err.localizedDescription) - } - } -} diff --git a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/route53/Route53InvalidBatchErrorIntegration.kt b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/route53/Route53InvalidBatchErrorIntegration.kt index e7fb0b89810..259ebc20ff6 100644 --- a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/route53/Route53InvalidBatchErrorIntegration.kt +++ b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/route53/Route53InvalidBatchErrorIntegration.kt @@ -16,7 +16,8 @@ import software.amazon.smithy.swift.codegen.model.expectShape class Route53InvalidBatchErrorIntegration : SwiftIntegration { override fun enabledForService(model: Model, settings: SwiftSettings): Boolean { - return model.expectShape(settings.service).isRoute53 +// return model.expectShape(settings.service).isRoute53 + return false } override val sectionWriters: List