Skip to content

Commit

Permalink
Merge pull request #99 from amzn/code_generate_2_40_34
Browse files Browse the repository at this point in the history
Code generate with Go SDK v1.40.34 models.
  • Loading branch information
tachyonics authored Sep 1, 2021
2 parents e45bc7f + 8c71b4f commit 2308e03
Show file tree
Hide file tree
Showing 16 changed files with 402 additions and 0 deletions.
78 changes: 78 additions & 0 deletions Sources/CloudformationClient/AWSCloudformationClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4225,6 +4225,84 @@ public struct AWSCloudformationClient<InvocationReportingType: HTTPClientCoreInv
}
}

/**
Invokes the RollbackStack operation returning immediately and passing the response to a callback.

- Parameters:
- input: The validated RollbackStackInput object being passed to this operation.
- completion: The RollbackStackOutputForRollbackStack object or an error will be passed to this
callback when the operation is complete. The RollbackStackOutputForRollbackStack
object will be validated before being returned to caller.
The possible errors are: tokenAlreadyExists.
*/
public func rollbackStackAsync(
input: CloudformationModel.RollbackStackInput,
completion: @escaping (Result<CloudformationModel.RollbackStackOutputForRollbackStack, CloudformationError>) -> ()) throws {
let handlerDelegate = AWSClientInvocationDelegate(
credentialsProvider: credentialsProvider,
awsRegion: awsRegion,
service: service,
target: target)

let invocationContext = HTTPClientInvocationContext(reporting: self.invocationsReporting.rollbackStack,
handlerDelegate: handlerDelegate)
let wrappedInput = RollbackStackOperationHTTPRequestInput(encodable: input)

let requestInput = QueryWrapperHTTPRequestInput(
wrappedInput: wrappedInput,
action: CloudformationModelOperations.rollbackStack.rawValue,
version: apiVersion)

_ = try httpClient.executeOperationAsyncRetriableWithOutput(
endpointPath: "/",
httpMethod: .POST,
input: requestInput,
completion: completion,
invocationContext: invocationContext,
retryConfiguration: retryConfiguration,
retryOnError: retryOnErrorProvider)
}

/**
Invokes the RollbackStack operation waiting for the response before returning.

- Parameters:
- input: The validated RollbackStackInput object being passed to this operation.
- Returns: The RollbackStackOutputForRollbackStack object to be passed back from the caller of this operation.
Will be validated before being returned to caller.
- Throws: tokenAlreadyExists.
*/
public func rollbackStackSync(
input: CloudformationModel.RollbackStackInput) throws -> CloudformationModel.RollbackStackOutputForRollbackStack {
let handlerDelegate = AWSClientInvocationDelegate(
credentialsProvider: credentialsProvider,
awsRegion: awsRegion,
service: service,
target: target)

let invocationContext = HTTPClientInvocationContext(reporting: self.invocationsReporting.rollbackStack,
handlerDelegate: handlerDelegate)
let wrappedInput = RollbackStackOperationHTTPRequestInput(encodable: input)

let requestInput = QueryWrapperHTTPRequestInput(
wrappedInput: wrappedInput,
action: CloudformationModelOperations.rollbackStack.rawValue,
version: apiVersion)

do {
return try httpClient.executeSyncRetriableWithOutput(
endpointPath: "/",
httpMethod: .POST,
input: requestInput,
invocationContext: invocationContext,
retryConfiguration: retryConfiguration,
retryOnError: retryOnErrorProvider)
} catch {
let typedError: CloudformationError = error.asTypedError()
throw typedError
}
}

/**
Invokes the SetStackPolicy operation returning immediately and passing the response to a callback.

Expand Down
31 changes: 31 additions & 0 deletions Sources/CloudformationClient/CloudformationClientProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ public protocol CloudformationClientProtocol {
typealias RegisterTypeAsyncType = (
_ input: CloudformationModel.RegisterTypeInput,
_ completion: @escaping (Result<CloudformationModel.RegisterTypeOutputForRegisterType, CloudformationError>) -> ()) throws -> ()
typealias RollbackStackSyncType = (
_ input: CloudformationModel.RollbackStackInput) throws -> CloudformationModel.RollbackStackOutputForRollbackStack
typealias RollbackStackAsyncType = (
_ input: CloudformationModel.RollbackStackInput,
_ completion: @escaping (Result<CloudformationModel.RollbackStackOutputForRollbackStack, CloudformationError>) -> ()) throws -> ()
typealias SetStackPolicySyncType = (
_ input: CloudformationModel.SetStackPolicyInput) throws -> ()
typealias SetStackPolicyAsyncType = (
Expand Down Expand Up @@ -1688,6 +1693,32 @@ public protocol CloudformationClientProtocol {
func registerTypeSync(
input: CloudformationModel.RegisterTypeInput) throws -> CloudformationModel.RegisterTypeOutputForRegisterType

/**
Invokes the RollbackStack operation returning immediately and passing the response to a callback.

- Parameters:
- input: The validated RollbackStackInput object being passed to this operation.
- completion: The RollbackStackOutputForRollbackStack object or an error will be passed to this
callback when the operation is complete. The RollbackStackOutputForRollbackStack
object will be validated before being returned to caller.
The possible errors are: tokenAlreadyExists.
*/
func rollbackStackAsync(
input: CloudformationModel.RollbackStackInput,
completion: @escaping (Result<CloudformationModel.RollbackStackOutputForRollbackStack, CloudformationError>) -> ()) throws

/**
Invokes the RollbackStack operation waiting for the response before returning.

- Parameters:
- input: The validated RollbackStackInput object being passed to this operation.
- Returns: The RollbackStackOutputForRollbackStack object to be passed back from the caller of this operation.
Will be validated before being returned to caller.
- Throws: tokenAlreadyExists.
*/
func rollbackStackSync(
input: CloudformationModel.RollbackStackInput) throws -> CloudformationModel.RollbackStackOutputForRollbackStack

/**
Invokes the SetStackPolicy operation returning immediately and passing the response to a callback.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public struct CloudformationInvocationsReporting<InvocationReportingType: HTTPCl
public let recordHandlerProgress: SmokeAWSHTTPClientInvocationReporting<InvocationReportingType>
public let registerPublisher: SmokeAWSHTTPClientInvocationReporting<InvocationReportingType>
public let registerType: SmokeAWSHTTPClientInvocationReporting<InvocationReportingType>
public let rollbackStack: SmokeAWSHTTPClientInvocationReporting<InvocationReportingType>
public let setStackPolicy: SmokeAWSHTTPClientInvocationReporting<InvocationReportingType>
public let setTypeConfiguration: SmokeAWSHTTPClientInvocationReporting<InvocationReportingType>
public let setTypeDefaultVersion: SmokeAWSHTTPClientInvocationReporting<InvocationReportingType>
Expand Down Expand Up @@ -201,6 +202,8 @@ public struct CloudformationInvocationsReporting<InvocationReportingType: HTTPCl
smokeAWSOperationReporting: operationsReporting.registerPublisher)
self.registerType = SmokeAWSHTTPClientInvocationReporting(smokeAWSInvocationReporting: reporting,
smokeAWSOperationReporting: operationsReporting.registerType)
self.rollbackStack = SmokeAWSHTTPClientInvocationReporting(smokeAWSInvocationReporting: reporting,
smokeAWSOperationReporting: operationsReporting.rollbackStack)
self.setStackPolicy = SmokeAWSHTTPClientInvocationReporting(smokeAWSInvocationReporting: reporting,
smokeAWSOperationReporting: operationsReporting.setStackPolicy)
self.setTypeConfiguration = SmokeAWSHTTPClientInvocationReporting(smokeAWSInvocationReporting: reporting,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ public typealias RegisterPublisherOperationHTTPRequestInput = QueryHTTPRequestIn
*/
public typealias RegisterTypeOperationHTTPRequestInput = QueryHTTPRequestInput

/**
Type to handle the input to the RollbackStack operation in a HTTP client.
*/
public typealias RollbackStackOperationHTTPRequestInput = QueryHTTPRequestInput

/**
Type to handle the input to the SetStackPolicy operation in a HTTP client.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,19 @@ extension RegisterTypeOutputForRegisterType: HTTPResponseOutputProtocol {
}
}

/**
Type to handle the output from the RollbackStack operation in a HTTP client.
*/
extension RollbackStackOutputForRollbackStack: HTTPResponseOutputProtocol {
public typealias BodyType = RollbackStackOutputForRollbackStack
public typealias HeadersType = RollbackStackOutputForRollbackStack

public static func compose(bodyDecodableProvider: () throws -> BodyType,
headersDecodableProvider: () throws -> HeadersType) throws -> RollbackStackOutputForRollbackStack {
return try bodyDecodableProvider()
}
}

/**
Type to handle the output from the SetTypeConfiguration operation in a HTTP client.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public struct CloudformationOperationsReporting {
public let recordHandlerProgress: StandardSmokeAWSOperationReporting<CloudformationModelOperations>
public let registerPublisher: StandardSmokeAWSOperationReporting<CloudformationModelOperations>
public let registerType: StandardSmokeAWSOperationReporting<CloudformationModelOperations>
public let rollbackStack: StandardSmokeAWSOperationReporting<CloudformationModelOperations>
public let setStackPolicy: StandardSmokeAWSOperationReporting<CloudformationModelOperations>
public let setTypeConfiguration: StandardSmokeAWSOperationReporting<CloudformationModelOperations>
public let setTypeDefaultVersion: StandardSmokeAWSOperationReporting<CloudformationModelOperations>
Expand Down Expand Up @@ -200,6 +201,8 @@ public struct CloudformationOperationsReporting {
clientName: clientName, operation: .registerPublisher, configuration: reportingConfiguration)
self.registerType = StandardSmokeAWSOperationReporting(
clientName: clientName, operation: .registerType, configuration: reportingConfiguration)
self.rollbackStack = StandardSmokeAWSOperationReporting(
clientName: clientName, operation: .rollbackStack, configuration: reportingConfiguration)
self.setStackPolicy = StandardSmokeAWSOperationReporting(
clientName: clientName, operation: .setStackPolicy, configuration: reportingConfiguration)
self.setTypeConfiguration = StandardSmokeAWSOperationReporting(
Expand Down
46 changes: 46 additions & 0 deletions Sources/CloudformationClient/MockCloudformationClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ public struct MockCloudformationClient: CloudformationClientProtocol {
let registerPublisherSyncOverride: RegisterPublisherSyncType?
let registerTypeAsyncOverride: RegisterTypeAsyncType?
let registerTypeSyncOverride: RegisterTypeSyncType?
let rollbackStackAsyncOverride: RollbackStackAsyncType?
let rollbackStackSyncOverride: RollbackStackSyncType?
let setStackPolicyAsyncOverride: SetStackPolicyAsyncType?
let setStackPolicySyncOverride: SetStackPolicySyncType?
let setTypeConfigurationAsyncOverride: SetTypeConfigurationAsyncType?
Expand Down Expand Up @@ -269,6 +271,8 @@ public struct MockCloudformationClient: CloudformationClientProtocol {
registerPublisherSync: RegisterPublisherSyncType? = nil,
registerTypeAsync: RegisterTypeAsyncType? = nil,
registerTypeSync: RegisterTypeSyncType? = nil,
rollbackStackAsync: RollbackStackAsyncType? = nil,
rollbackStackSync: RollbackStackSyncType? = nil,
setStackPolicyAsync: SetStackPolicyAsyncType? = nil,
setStackPolicySync: SetStackPolicySyncType? = nil,
setTypeConfigurationAsync: SetTypeConfigurationAsyncType? = nil,
Expand Down Expand Up @@ -397,6 +401,8 @@ public struct MockCloudformationClient: CloudformationClientProtocol {
self.registerPublisherSyncOverride = registerPublisherSync
self.registerTypeAsyncOverride = registerTypeAsync
self.registerTypeSyncOverride = registerTypeSync
self.rollbackStackAsyncOverride = rollbackStackAsync
self.rollbackStackSyncOverride = rollbackStackSync
self.setStackPolicyAsyncOverride = setStackPolicyAsync
self.setStackPolicySyncOverride = setStackPolicySync
self.setTypeConfigurationAsyncOverride = setTypeConfigurationAsync
Expand Down Expand Up @@ -2495,6 +2501,46 @@ public struct MockCloudformationClient: CloudformationClientProtocol {
return RegisterTypeOutputForRegisterType.__default
}

/**
Invokes the RollbackStack operation returning immediately and passing the response to a callback.

- Parameters:
- input: The validated RollbackStackInput object being passed to this operation.
- completion: The RollbackStackOutputForRollbackStack object or an error will be passed to this
callback when the operation is complete. The RollbackStackOutputForRollbackStack
object will be validated before being returned to caller.
The possible errors are: tokenAlreadyExists.
*/
public func rollbackStackAsync(
input: CloudformationModel.RollbackStackInput,
completion: @escaping (Result<CloudformationModel.RollbackStackOutputForRollbackStack, CloudformationError>) -> ()) throws {
if let rollbackStackAsyncOverride = rollbackStackAsyncOverride {
return try rollbackStackAsyncOverride(input, completion)
}

let result = RollbackStackOutputForRollbackStack.__default

completion(.success(result))
}

/**
Invokes the RollbackStack operation waiting for the response before returning.

- Parameters:
- input: The validated RollbackStackInput object being passed to this operation.
- Returns: The RollbackStackOutputForRollbackStack object to be passed back from the caller of this operation.
Will be validated before being returned to caller.
- Throws: tokenAlreadyExists.
*/
public func rollbackStackSync(
input: CloudformationModel.RollbackStackInput) throws -> CloudformationModel.RollbackStackOutputForRollbackStack {
if let rollbackStackSyncOverride = rollbackStackSyncOverride {
return try rollbackStackSyncOverride(input)
}

return RollbackStackOutputForRollbackStack.__default
}

/**
Invokes the SetStackPolicy operation returning immediately and passing the response to a callback.

Expand Down
44 changes: 44 additions & 0 deletions Sources/CloudformationClient/ThrowingCloudformationClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ public struct ThrowingCloudformationClient: CloudformationClientProtocol {
let registerPublisherSyncOverride: RegisterPublisherSyncType?
let registerTypeAsyncOverride: RegisterTypeAsyncType?
let registerTypeSyncOverride: RegisterTypeSyncType?
let rollbackStackAsyncOverride: RollbackStackAsyncType?
let rollbackStackSyncOverride: RollbackStackSyncType?
let setStackPolicyAsyncOverride: SetStackPolicyAsyncType?
let setStackPolicySyncOverride: SetStackPolicySyncType?
let setTypeConfigurationAsyncOverride: SetTypeConfigurationAsyncType?
Expand Down Expand Up @@ -270,6 +272,8 @@ public struct ThrowingCloudformationClient: CloudformationClientProtocol {
registerPublisherSync: RegisterPublisherSyncType? = nil,
registerTypeAsync: RegisterTypeAsyncType? = nil,
registerTypeSync: RegisterTypeSyncType? = nil,
rollbackStackAsync: RollbackStackAsyncType? = nil,
rollbackStackSync: RollbackStackSyncType? = nil,
setStackPolicyAsync: SetStackPolicyAsyncType? = nil,
setStackPolicySync: SetStackPolicySyncType? = nil,
setTypeConfigurationAsync: SetTypeConfigurationAsyncType? = nil,
Expand Down Expand Up @@ -399,6 +403,8 @@ public struct ThrowingCloudformationClient: CloudformationClientProtocol {
self.registerPublisherSyncOverride = registerPublisherSync
self.registerTypeAsyncOverride = registerTypeAsync
self.registerTypeSyncOverride = registerTypeSync
self.rollbackStackAsyncOverride = rollbackStackAsync
self.rollbackStackSyncOverride = rollbackStackSync
self.setStackPolicyAsyncOverride = setStackPolicyAsync
self.setStackPolicySyncOverride = setStackPolicySync
self.setTypeConfigurationAsyncOverride = setTypeConfigurationAsync
Expand Down Expand Up @@ -2397,6 +2403,44 @@ public struct ThrowingCloudformationClient: CloudformationClientProtocol {
throw error
}

/**
Invokes the RollbackStack operation returning immediately and passing the response to a callback.

- Parameters:
- input: The validated RollbackStackInput object being passed to this operation.
- completion: The RollbackStackOutputForRollbackStack object or an error will be passed to this
callback when the operation is complete. The RollbackStackOutputForRollbackStack
object will be validated before being returned to caller.
The possible errors are: tokenAlreadyExists.
*/
public func rollbackStackAsync(
input: CloudformationModel.RollbackStackInput,
completion: @escaping (Result<CloudformationModel.RollbackStackOutputForRollbackStack, CloudformationError>) -> ()) throws {
if let rollbackStackAsyncOverride = rollbackStackAsyncOverride {
return try rollbackStackAsyncOverride(input, completion)
}

completion(.failure(error))
}

/**
Invokes the RollbackStack operation waiting for the response before returning.

- Parameters:
- input: The validated RollbackStackInput object being passed to this operation.
- Returns: The RollbackStackOutputForRollbackStack object to be passed back from the caller of this operation.
Will be validated before being returned to caller.
- Throws: tokenAlreadyExists.
*/
public func rollbackStackSync(
input: CloudformationModel.RollbackStackInput) throws -> CloudformationModel.RollbackStackOutputForRollbackStack {
if let rollbackStackSyncOverride = rollbackStackSyncOverride {
return try rollbackStackSyncOverride(input)
}

throw error
}

/**
Invokes the SetStackPolicy operation returning immediately and passing the response to a callback.

Expand Down
Loading

0 comments on commit 2308e03

Please sign in to comment.