Skip to content

Commit

Permalink
fix!: Make error factory methods nonpublic (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelkins authored Sep 27, 2023
1 parent ace826d commit 17f7102
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ class AWSJsonHttpResponseBindingErrorGenerator : HttpResponseBindingErrorGenerat
addImport(SwiftDependency.CLIENT_RUNTIME.target)

openBlock(
"public enum \$L: \$N {",
"enum \$L: \$N {",
"}",
operationErrorName,
ClientRuntimeTypes.Http.HttpResponseErrorBinding
) {
openBlock(
"public static func makeError(httpResponse: \$N, decoder: \$D) async throws -> \$N {", "}",
"static func makeError(httpResponse: \$N, decoder: \$D) async throws -> \$N {", "}",
ClientRuntimeTypes.Http.HttpResponse,
ClientRuntimeTypes.Serde.ResponseDecoder,
SwiftTypes.Error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ class AWSEc2QueryHttpResponseBindingErrorGenerator : HttpResponseBindingErrorGen
addImport(SwiftDependency.CLIENT_RUNTIME.target)

openBlock(
"public enum \$L: \$N {",
"enum \$L: \$N {",
"}",
operationErrorName,
ClientRuntimeTypes.Http.HttpResponseErrorBinding
) {
openBlock(
"public static func makeError(httpResponse: \$N, decoder: \$D) async throws -> \$N {", "}",
"static func makeError(httpResponse: \$N, decoder: \$D) async throws -> \$N {", "}",
ClientRuntimeTypes.Http.HttpResponse,
ClientRuntimeTypes.Serde.ResponseDecoder,
SwiftTypes.Error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ class AWSRestJson1HttpResponseBindingErrorGeneratable : HttpResponseBindingError
addImport(SwiftDependency.CLIENT_RUNTIME.target)

openBlock(
"public enum \$L: \$N {",
"enum \$L: \$N {",
"}",
operationErrorName,
ClientRuntimeTypes.Http.HttpResponseErrorBinding
) {
openBlock(
"public static func makeError(httpResponse: \$N, decoder: \$D) async throws -> \$N {", "}",
"static func makeError(httpResponse: \$N, decoder: \$D) async throws -> \$N {", "}",
ClientRuntimeTypes.Http.HttpResponse,
ClientRuntimeTypes.Serde.ResponseDecoder,
SwiftTypes.Error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ class AWSRestXMLHttpResponseBindingErrorGenerator : HttpResponseBindingErrorGene
addImport(SwiftDependency.CLIENT_RUNTIME.target)

openBlock(
"public enum \$L: \$N {",
"enum \$L: \$N {",
"}",
operationErrorName,
ClientRuntimeTypes.Http.HttpResponseErrorBinding
) {
openBlock(
"public static func makeError(httpResponse: \$N, decoder: \$D) async throws -> \$N {", "}",
"static func makeError(httpResponse: \$N, decoder: \$D) async throws -> \$N {", "}",
ClientRuntimeTypes.Http.HttpResponse,
ClientRuntimeTypes.Serde.ResponseDecoder,
SwiftTypes.Error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class AWSJsonHttpResponseBindingErrorGeneratorTests {
contents.shouldSyntacticSanityCheck()
val expectedContents =
"""
public enum GreetingWithErrorsOutputError: ClientRuntime.HttpResponseErrorBinding {
public static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder? = nil) async throws -> Swift.Error {
enum GreetingWithErrorsOutputError: ClientRuntime.HttpResponseErrorBinding {
static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder? = nil) async throws -> Swift.Error {
let restJSONError = try await AWSClientRuntime.RestJSONError(httpResponse: httpResponse)
let requestID = httpResponse.requestId
let serviceError = try await Json10ProtocolClientTypes.makeServiceError(httpResponse, decoder, restJSONError, requestID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class AWSRestJson1HttpResponseBindingErrorGeneratableTests {
contents.shouldSyntacticSanityCheck()
val expectedContents =
"""
public enum GreetingWithErrorsOutputError: ClientRuntime.HttpResponseErrorBinding {
public static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder? = nil) async throws -> Swift.Error {
enum GreetingWithErrorsOutputError: ClientRuntime.HttpResponseErrorBinding {
static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder? = nil) async throws -> Swift.Error {
let restJSONError = try await AWSClientRuntime.RestJSONError(httpResponse: httpResponse)
let requestID = httpResponse.requestId
let serviceError = try await RestJson1ProtocolClientTypes.makeServiceError(httpResponse, decoder, restJSONError, requestID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class Route53InvalidBatchErrorIntegrationTests {
contents.shouldSyntacticSanityCheck()
val expectedContents =
"""
public enum ChangeResourceRecordSetsOutputError: ClientRuntime.HttpResponseErrorBinding {
public static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder? = nil) async throws -> Swift.Error {
enum ChangeResourceRecordSetsOutputError: ClientRuntime.HttpResponseErrorBinding {
static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder? = nil) async throws -> Swift.Error {
if let customBatchError = try await CustomInvalidBatchError.makeFromHttpResponse(httpResponse) {
return InvalidChangeBatch(
customError: customBatchError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Ec2QueryHttpResponseBindingErrorGeneratorTests {
contents.shouldSyntacticSanityCheck()
val expectedContents =
"""
public enum GreetingWithErrorsOutputError: ClientRuntime.HttpResponseErrorBinding {
public static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder? = nil) async throws -> Swift.Error {
enum GreetingWithErrorsOutputError: ClientRuntime.HttpResponseErrorBinding {
static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder? = nil) async throws -> Swift.Error {
let ec2QueryError = try await Ec2QueryError(httpResponse: httpResponse)
let serviceError = try await EC2ProtocolClientTypes.makeServiceError(httpResponse, decoder, ec2QueryError)
if let error = serviceError { return error }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class AWSRestXMLHttpResponseBindingErrorGeneratorTests {
contents.shouldSyntacticSanityCheck()
val expectedContents =
"""
public enum GreetingWithErrorsOutputError: ClientRuntime.HttpResponseErrorBinding {
public static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder? = nil) async throws -> Swift.Error {
enum GreetingWithErrorsOutputError: ClientRuntime.HttpResponseErrorBinding {
static func makeError(httpResponse: ClientRuntime.HttpResponse, decoder: ClientRuntime.ResponseDecoder? = nil) async throws -> Swift.Error {
let restXMLError = try await AWSClientRuntime.RestXMLError(httpResponse: httpResponse)
let serviceError = try await RestXmlerrorsClientTypes.makeServiceError(httpResponse, decoder, restXMLError)
if let error = serviceError { return error }
Expand Down

0 comments on commit 17f7102

Please sign in to comment.