Skip to content

Commit

Permalink
fix!: update shape and member extensions to use same casing as rest o…
Browse files Browse the repository at this point in the history
…f the system (#684)
  • Loading branch information
Ganesh Jangir authored Nov 8, 2022
1 parent c15dbda commit a89ec7b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion AWSClientRuntime/Sources/AWSClientConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public protocol AWSRuntimeConfiguration {
var signingRegion: String? {get set}
var regionResolver: RegionResolver? {get set}
var frameworkMetadata: FrameworkMetadata? {get set}
var useFips: Bool? {get set}
var useFIPS: Bool? {get set}
var useDualStack: Bool? {get set}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const val FRAMEWORK_METADATA = "frameworkMetadata"
const val REGION_CONFIG_NAME = "region"
const val REGION_RESOLVER = "regionResolver"
const val SIGNING_REGION_CONFIG_NAME = "signingRegion"
const val USE_FIPS_CONFIG_NAME = "useFips"
const val USE_FIPS_CONFIG_NAME = "useFIPS"
const val USE_DUAL_STACK_CONFIG_NAME = "useDualStack"
const val RUNTIME_CONFIG_NAME = "runtimeConfig"
const val ENDPOINT_CONFIG_NAME = "endpoint"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import software.amazon.smithy.swift.codegen.ClientRuntimeTypes
import software.amazon.smithy.swift.codegen.SwiftDependency
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
import software.amazon.smithy.swift.codegen.integration.httpResponse.HttpResponseBindingErrorGeneratable
import software.amazon.smithy.swift.codegen.model.capitalizedName
import software.amazon.smithy.swift.codegen.model.toUpperCamelCase

/*
* TODO: The code below is not valid for AWS Json 1.0/1.1.
* This code was lifted from restJson to make tests compile and run for Json 1.0/1.1
*/
class AWSJsonHttpResponseBindingErrorGenerator : HttpResponseBindingErrorGeneratable {
override fun render(ctx: ProtocolGenerator.GenerationContext, op: OperationShape) {
val operationErrorName = "${op.capitalizedName()}OutputError"
val operationErrorName = "${op.toUpperCamelCase()}OutputError"
val rootNamespace = ctx.settings.moduleName
val httpBindingSymbol = Symbol.builder()
.definitionFile("./$rootNamespace/models/$operationErrorName+HttpResponseBinding.swift")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import software.amazon.smithy.swift.codegen.ClientRuntimeTypes
import software.amazon.smithy.swift.codegen.SwiftDependency
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
import software.amazon.smithy.swift.codegen.integration.httpResponse.HttpResponseBindingErrorGeneratable
import software.amazon.smithy.swift.codegen.model.capitalizedName
import software.amazon.smithy.swift.codegen.model.toUpperCamelCase

class AWSEc2QueryHttpResponseBindingErrorGenerator : HttpResponseBindingErrorGeneratable {
override fun render(ctx: ProtocolGenerator.GenerationContext, op: OperationShape) {
val operationErrorName = "${op.capitalizedName()}OutputError"
val operationErrorName = "${op.toUpperCamelCase()}OutputError"
val rootNamespace = ctx.settings.moduleName
val httpBindingSymbol = Symbol.builder()
.definitionFile("./$rootNamespace/models/$operationErrorName+HttpResponseBinding.swift")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import software.amazon.smithy.swift.codegen.ClientRuntimeTypes
import software.amazon.smithy.swift.codegen.SwiftDependency
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
import software.amazon.smithy.swift.codegen.integration.httpResponse.HttpResponseBindingErrorGeneratable
import software.amazon.smithy.swift.codegen.model.capitalizedName
import software.amazon.smithy.swift.codegen.model.toUpperCamelCase

class AWSRestJson1HttpResponseBindingErrorGeneratable : HttpResponseBindingErrorGeneratable {
override fun render(ctx: ProtocolGenerator.GenerationContext, op: OperationShape) {
val operationErrorName = "${op.capitalizedName()}OutputError"
val operationErrorName = "${op.toUpperCamelCase()}OutputError"
val rootNamespace = ctx.settings.moduleName
val httpBindingSymbol = Symbol.builder()
.definitionFile("./$rootNamespace/models/$operationErrorName+HttpResponseBinding.swift")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import software.amazon.smithy.swift.codegen.declareSection
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
import software.amazon.smithy.swift.codegen.integration.SectionId
import software.amazon.smithy.swift.codegen.integration.httpResponse.HttpResponseBindingErrorGeneratable
import software.amazon.smithy.swift.codegen.model.capitalizedName
import software.amazon.smithy.swift.codegen.model.toUpperCamelCase

class AWSRestXMLHttpResponseBindingErrorGenerator : HttpResponseBindingErrorGeneratable {

object RestXMLResponseBindingSectionId : SectionId

override fun render(ctx: ProtocolGenerator.GenerationContext, op: OperationShape) {
val operationErrorName = "${op.capitalizedName()}OutputError"
val operationErrorName = "${op.toUpperCamelCase()}OutputError"
val rootNamespace = ctx.settings.moduleName
val httpBindingSymbol = Symbol.builder()
.definitionFile("./$rootNamespace/models/$operationErrorName+HttpResponseBinding.swift")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class RestJsonProtocolGeneratorTests {
public var regionResolver: AWSClientRuntime.RegionResolver?
public var signingRegion: Swift.String?
public var useDualStack: Swift.Bool?
public var useFips: Swift.Bool?
public var useFIPS: Swift.Bool?
public var endpointResolver: EndpointResolver
Expand All @@ -142,7 +142,7 @@ class RestJsonProtocolGeneratorTests {
runtimeConfig: ClientRuntime.SDKRuntimeConfiguration,
signingRegion: Swift.String? = nil,
useDualStack: Swift.Bool? = nil,
useFips: Swift.Bool? = nil
useFIPS: Swift.Bool? = nil
) throws {
if let credProvider = credentialsProvider {
self.credentialsProvider = try AWSClientRuntime.AWSCredentialsProvider.fromCustom(credProvider)
Expand All @@ -160,7 +160,7 @@ class RestJsonProtocolGeneratorTests {
self.regionResolver = regionResolver ?? DefaultRegionResolver()
self.signingRegion = signingRegion ?? region
self.useDualStack = useDualStack
self.useFips = useFips
self.useFIPS = useFIPS
self.clientLogMode = runtimeConfig.clientLogMode
self.decoder = runtimeConfig.decoder
self.encoder = runtimeConfig.encoder
Expand All @@ -180,7 +180,7 @@ class RestJsonProtocolGeneratorTests {
regionResolver: AWSClientRuntime.RegionResolver? = nil,
signingRegion: Swift.String? = nil,
useDualStack: Swift.Bool? = nil,
useFips: Swift.Bool? = nil
useFIPS: Swift.Bool? = nil
) throws {
let runtimeConfig = try ClientRuntime.DefaultSDKRuntimeConfiguration("ExampleClient")
try self.init(
Expand All @@ -193,7 +193,7 @@ class RestJsonProtocolGeneratorTests {
runtimeConfig: runtimeConfig,
signingRegion: signingRegion,
useDualStack: useDualStack,
useFips: useFips
useFIPS: useFIPS
)
}
Expand All @@ -206,7 +206,7 @@ class RestJsonProtocolGeneratorTests {
runtimeConfig: ClientRuntime.SDKRuntimeConfiguration,
signingRegion: Swift.String? = nil,
useDualStack: Swift.Bool? = nil,
useFips: Swift.Bool? = nil
useFIPS: Swift.Bool? = nil
) async throws {
if let credProvider = credentialsProvider {
self.credentialsProvider = try AWSClientRuntime.AWSCredentialsProvider.fromCustom(credProvider)
Expand All @@ -225,7 +225,7 @@ class RestJsonProtocolGeneratorTests {
self.regionResolver = regionResolver ?? DefaultRegionResolver()
self.signingRegion = signingRegion ?? region
self.useDualStack = useDualStack
self.useFips = useFips
self.useFIPS = useFIPS
self.clientLogMode = runtimeConfig.clientLogMode
self.decoder = runtimeConfig.decoder
self.encoder = runtimeConfig.encoder
Expand All @@ -244,7 +244,7 @@ class RestJsonProtocolGeneratorTests {
regionResolver: AWSClientRuntime.RegionResolver? = nil,
signingRegion: Swift.String? = nil,
useDualStack: Swift.Bool? = nil,
useFips: Swift.Bool? = nil
useFIPS: Swift.Bool? = nil
) async throws {
let runtimeConfig = try ClientRuntime.DefaultSDKRuntimeConfiguration("ExampleClient")
try await self.init(
Expand All @@ -256,7 +256,7 @@ class RestJsonProtocolGeneratorTests {
runtimeConfig: runtimeConfig,
signingRegion: signingRegion,
useDualStack: useDualStack,
useFips: useFips
useFIPS: useFIPS
)
}
Expand Down

0 comments on commit a89ec7b

Please sign in to comment.