Skip to content

Commit

Permalink
Add aws.protocols#awsQueryCompatible
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Dec 4, 2023
1 parent b84bf61 commit 73074e9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sources/SotoSmithyAWS/Smithy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ extension Smithy {
AwsProtocolsAwsJson1_1Trait.self,
AwsProtocolsAwsQueryTrait.self,
AwsProtocolsAwsQueryErrorTrait.self,
AwsProtocolsAwsQueryCompatibleTrait.self,
AwsProtocolsEc2QueryTrait.self,
AwsProtocolsRestXmlTrait.self,
AwsProtocolsEc2QueryNameTrait.self,
Expand Down
18 changes: 18 additions & 0 deletions Sources/SotoSmithyAWS/Traits/AwsProtocolTraits.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ public struct AwsProtocolsAwsQueryErrorTrait: StaticTrait {
}
}

/// When using the awsQuery protocol, custom Code and HTTP response code values can be defined
/// for an error response via the awsQueryError trait.
///
/// The awsQueryCompatible trait allows services to backward compatibly migrate from awsQuery
/// to awsJson1_0 without removing values defined in the awsQueryError trait.
///
/// This trait adds the x-amzn-query-error header in the form of Code;Fault to error responses.
/// Code is the value defined in the awsQueryError, and Fault is one of Sender or Receiver.
public struct AwsProtocolsAwsQueryCompatibleTrait: StaticTrait {
public static let staticName: ShapeId = "aws.protocols#awsQueryCompatible"
public var selector: Selector {
AndSelector(
TypeSelector<ServiceShape>(),
TraitSelector<AwsProtocolsAwsJson1_0Trait>()
)
}
}

/// Adds support for an HTTP protocol that sends requests in the query string OR in a x-form-url-encoded body
/// and responses in XML documents. This protocol is an Amazon EC2-specific extension of the awsQuery protocol.
public struct AwsProtocolsEc2QueryTrait: StaticTrait {
Expand Down

0 comments on commit 73074e9

Please sign in to comment.