diff --git a/Package.swift b/Package.swift index cd427af5aff..efe93ab0226 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ import PackageDescription // MARK: - Dynamic Content -let clientRuntimeVersion: Version = "0.77.0" +let clientRuntimeVersion: Version = "0.78.0" let crtVersion: Version = "0.36.0" let excludeRuntimeUnitTests = false @@ -373,6 +373,7 @@ let serviceTargets: [String] = [ "AWSSimSpaceWeaver", "AWSSnowDeviceManagement", "AWSSnowball", + "AWSSocialMessaging", "AWSSsmSap", "AWSStorageGateway", "AWSSupplyChain", diff --git a/Package.version b/Package.version index d941c12bd04..e92964fe32e 100644 --- a/Package.version +++ b/Package.version @@ -1 +1 @@ -1.0.16 \ No newline at end of file +1.0.17 \ No newline at end of file diff --git a/Package.version.next b/Package.version.next index e92964fe32e..c678b02c1ad 100644 --- a/Package.version.next +++ b/Package.version.next @@ -1 +1 @@ -1.0.17 \ No newline at end of file +1.0.18 \ No newline at end of file diff --git a/Sources/Core/AWSSDKForSwift/Documentation.docc/AWSSDKForSwift.md b/Sources/Core/AWSSDKForSwift/Documentation.docc/AWSSDKForSwift.md index 62e59b2fea0..2784493c3eb 100644 --- a/Sources/Core/AWSSDKForSwift/Documentation.docc/AWSSDKForSwift.md +++ b/Sources/Core/AWSSDKForSwift/Documentation.docc/AWSSDKForSwift.md @@ -779,6 +779,8 @@ This SDK is open-source. Code is available on Github [here](https://github.com/ [AWSSnowball](../../../../../swift/api/awssnowball/latest) +[AWSSocialMessaging](../../../../../swift/api/awssocialmessaging/latest) + [AWSSsmSap](../../../../../swift/api/awsssmsap/latest) [AWSStorageGateway](../../../../../swift/api/awsstoragegateway/latest) diff --git a/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/ACMPCAClient.swift b/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/ACMPCAClient.swift index 8b2c76fadbc..3b65f32175d 100644 --- a/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/ACMPCAClient.swift +++ b/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/ACMPCAClient.swift @@ -269,7 +269,7 @@ extension ACMPCAClient { /// Performs the `CreateCertificateAuthorityAuditReport` operation on the `ACMPrivateCA` service. /// - /// Creates an audit report that lists every time that your CA private key is used. The report is saved in the Amazon S3 bucket that you specify on input. The [IssueCertificate](https://docs.aws.amazon.com/privateca/latest/APIReference/API_IssueCertificate.html) and [RevokeCertificate](https://docs.aws.amazon.com/privateca/latest/APIReference/API_RevokeCertificate.html) actions use the private key. Both Amazon Web Services Private CA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see [Access policies for CRLs in Amazon S3](https://docs.aws.amazon.com/privateca/latest/userguide/crl-planning.html#s3-policies). Amazon Web Services Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see [Encrypting Your Audit Reports](https://docs.aws.amazon.com/privateca/latest/userguide/PcaAuditReport.html#audit-report-encryption). You can generate a maximum of one report every 30 minutes. + /// Creates an audit report that lists every time that your CA private key is used to issue a certificate. The [IssueCertificate](https://docs.aws.amazon.com/privateca/latest/APIReference/API_IssueCertificate.html) and [RevokeCertificate](https://docs.aws.amazon.com/privateca/latest/APIReference/API_RevokeCertificate.html) actions use the private key. To save the audit report to your designated Amazon S3 bucket, you must create a bucket policy that grants Amazon Web Services Private CA permission to access and write to it. For an example policy, see [Prepare an Amazon S3 bucket for audit reports](https://docs.aws.amazon.com/privateca/latest/userguide/PcaAuditReport.html#s3-access). Amazon Web Services Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see [Encrypting Your Audit Reports](https://docs.aws.amazon.com/privateca/latest/userguide/PcaAuditReport.html#audit-report-encryption). You can generate a maximum of one report every 30 minutes. /// /// - Parameter CreateCertificateAuthorityAuditReportInput : [no documentation found] /// @@ -1157,44 +1157,45 @@ extension ACMPCAClient { /// /// Enforcement of Critical Constraints Amazon Web Services Private CA allows the following extensions to be marked critical in the imported CA certificate or chain. /// - /// * Basic constraints (must be marked critical) + /// * Authority key identifier /// - /// * Subject alternative names + /// * Basic constraints (must be marked critical) /// - /// * Key usage + /// * Certificate policies /// /// * Extended key usage /// - /// * Authority key identifier - /// - /// * Subject key identifier + /// * Inhibit anyPolicy /// /// * Issuer alternative name /// - /// * Subject directory attributes - /// - /// * Subject information access + /// * Key usage /// - /// * Certificate policies + /// * Name constraints /// /// * Policy mappings /// - /// * Inhibit anyPolicy + /// * Subject alternative name /// + /// * Subject directory attributes /// - /// Amazon Web Services Private CA rejects the following extensions when they are marked critical in an imported CA certificate or chain. + /// * Subject key identifier /// - /// * Name constraints + /// * Subject information access /// - /// * Policy constraints /// - /// * CRL distribution points + /// Amazon Web Services Private CA rejects the following extensions when they are marked critical in an imported CA certificate or chain. /// /// * Authority information access /// + /// * CRL distribution points + /// /// * Freshest CRL /// - /// * Any other extension + /// * Policy constraints + /// + /// + /// Amazon Web Services Private Certificate Authority will also reject any other extension marked as critical not contained on the preceding list of allowed extensions. /// /// - Parameter ImportCertificateAuthorityCertificateInput : [no documentation found] /// diff --git a/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/Models.swift b/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/Models.swift index ffc2189b469..f3c2da412b4 100644 --- a/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/Models.swift +++ b/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/Models.swift @@ -901,7 +901,7 @@ public struct CreateCertificateAuthorityInput: Swift.Sendable { public var idempotencyToken: Swift.String? /// Specifies a cryptographic key management compliance standard used for handling CA keys. Default: FIPS_140_2_LEVEL_3_OR_HIGHER Some Amazon Web Services Regions do not support the default. When creating a CA in these Regions, you must provide FIPS_140_2_LEVEL_2_OR_HIGHER as the argument for KeyStorageSecurityStandard. Failure to do this results in an InvalidArgsException with the message, "A certificate authority cannot be created in this region with the specified security standard." For information about security standard support in various Regions, see [Storage and security compliance of Amazon Web Services Private CA private keys](https://docs.aws.amazon.com/privateca/latest/userguide/data-protection.html#private-keys). public var keyStorageSecurityStandard: ACMPCAClientTypes.KeyStorageSecurityStandard? - /// Contains information to enable Online Certificate Status Protocol (OCSP) support, to enable a certificate revocation list (CRL), to enable both, or to enable neither. The default is for both certificate validation mechanisms to be disabled. The following requirements apply to revocation configurations. + /// Contains information to enable support for Online Certificate Status Protocol (OCSP), certificate revocation list (CRL), both protocols, or neither. By default, both certificate validation mechanisms are disabled. The following requirements apply to revocation configurations. /// /// * A configuration disabling CRLs or OCSP must contain only the Enabled=False parameter, and will fail if other parameters such as CustomCname or ExpirationInDays are included. /// @@ -2559,7 +2559,7 @@ public struct UpdateCertificateAuthorityInput: Swift.Sendable { /// Amazon Resource Name (ARN) of the private CA that issued the certificate to be revoked. This must be of the form: arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 /// This member is required. public var certificateAuthorityArn: Swift.String? - /// Contains information to enable Online Certificate Status Protocol (OCSP) support, to enable a certificate revocation list (CRL), to enable both, or to enable neither. If this parameter is not supplied, existing capibilites remain unchanged. For more information, see the [OcspConfiguration](https://docs.aws.amazon.com/privateca/latest/APIReference/API_OcspConfiguration.html) and [CrlConfiguration](https://docs.aws.amazon.com/privateca/latest/APIReference/API_CrlConfiguration.html) types. The following requirements apply to revocation configurations. + /// Contains information to enable support for Online Certificate Status Protocol (OCSP), certificate revocation list (CRL), both protocols, or neither. If you don't supply this parameter, existing capibilites remain unchanged. For more information, see the [OcspConfiguration](https://docs.aws.amazon.com/privateca/latest/APIReference/API_OcspConfiguration.html) and [CrlConfiguration](https://docs.aws.amazon.com/privateca/latest/APIReference/API_CrlConfiguration.html) types. The following requirements apply to revocation configurations. /// /// * A configuration disabling CRLs or OCSP must contain only the Enabled=False parameter, and will fail if other parameters such as CustomCname or ExpirationInDays are included. /// @@ -2568,6 +2568,9 @@ public struct UpdateCertificateAuthorityInput: Swift.Sendable { /// * A configuration containing a custom Canonical Name (CNAME) parameter for CRLs or OCSP must conform to [RFC2396](https://www.ietf.org/rfc/rfc2396.txt) restrictions on the use of special characters in a CNAME. /// /// * In a CRL or OCSP configuration, the value of a CNAME parameter must not include a protocol prefix such as "http://" or "https://". + /// + /// + /// If you update the S3BucketName of [CrlConfiguration](https://docs.aws.amazon.com/privateca/latest/APIReference/API_CrlConfiguration.html), you can break revocation for existing certificates. In other words, if you call [UpdateCertificateAuthority](https://docs.aws.amazon.com/privateca/latest/APIReference/API_UpdateCertificateAuthority.html) to update the CRL configuration's S3 bucket name, Amazon Web Services Private CA only writes CRLs to the new S3 bucket. Certificates issued prior to this point will have the old S3 bucket name in your CRL Distribution Point (CDP) extension, essentially breaking revocation. If you must update the S3 bucket, you'll need to reissue old certificates to keep the revocation working. Alternatively, you can use a [CustomCname](https://docs.aws.amazon.com/privateca/latest/APIReference/API_CrlConfiguration.html#privateca-Type-CrlConfiguration-CustomCname) in your CRL configuration if you might need to change the S3 bucket name in the future. public var revocationConfiguration: ACMPCAClientTypes.RevocationConfiguration? /// Status of your private CA. public var status: ACMPCAClientTypes.CertificateAuthorityStatus? diff --git a/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/Waiters.swift b/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/Waiters.swift index f4f775d1d26..f508b1e5b86 100644 --- a/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/Waiters.swift +++ b/Sources/Services/AWSACMPCA/Sources/AWSACMPCA/Waiters.swift @@ -39,7 +39,7 @@ extension ACMPCAClient { return (error as? ClientRuntime.ServiceError)?.typeName == "AccessDeniedException" }), ] - return try SmithyWaitersAPI.WaiterConfiguration(acceptors: acceptors, minDelay: 3.0, maxDelay: 120.0) + return try SmithyWaitersAPI.WaiterConfiguration(acceptors: acceptors, minDelay: 3.0, maxDelay: 180.0) } /// Initiates waiting for the AuditReportCreated event on the describeCertificateAuthorityAuditReport operation. @@ -75,7 +75,7 @@ extension ACMPCAClient { return (error as? ClientRuntime.ServiceError)?.typeName == "AccessDeniedException" }), ] - return try SmithyWaitersAPI.WaiterConfiguration(acceptors: acceptors, minDelay: 1.0, maxDelay: 120.0) + return try SmithyWaitersAPI.WaiterConfiguration(acceptors: acceptors, minDelay: 1.0, maxDelay: 60.0) } /// Initiates waiting for the CertificateIssued event on the getCertificate operation. @@ -111,7 +111,7 @@ extension ACMPCAClient { return (error as? ClientRuntime.ServiceError)?.typeName == "AccessDeniedException" }), ] - return try SmithyWaitersAPI.WaiterConfiguration(acceptors: acceptors, minDelay: 3.0, maxDelay: 120.0) + return try SmithyWaitersAPI.WaiterConfiguration(acceptors: acceptors, minDelay: 3.0, maxDelay: 180.0) } /// Initiates waiting for the CertificateAuthorityCSRCreated event on the getCertificateAuthorityCsr operation. diff --git a/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/DatabaseMigrationClient.swift b/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/DatabaseMigrationClient.swift index 9fce2457377..95ed2c466a1 100644 --- a/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/DatabaseMigrationClient.swift +++ b/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/DatabaseMigrationClient.swift @@ -205,6 +205,7 @@ extension DatabaseMigrationClient { /// - Throws: One of the exceptions listed below __Possible Exceptions__. /// /// __Possible Exceptions:__ + /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. /// - `ResourceNotFoundFault` : The resource could not be found. public func addTagsToResource(input: AddTagsToResourceInput) async throws -> AddTagsToResourceOutput { let context = Smithy.ContextBuilder() @@ -478,6 +479,80 @@ extension DatabaseMigrationClient { return try await op.execute(input: input) } + /// Performs the `CreateDataMigration` operation on the `AmazonDMSv20160101` service. + /// + /// Creates a data migration using the provided settings. + /// + /// - Parameter CreateDataMigrationInput : [no documentation found] + /// + /// - Returns: `CreateDataMigrationOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `FailedDependencyFault` : A dependency threw an exception. + /// - `InvalidOperationFault` : The action or operation requested isn't valid. + /// - `ResourceAlreadyExistsFault` : The resource you are attempting to create already exists. + /// - `ResourceNotFoundFault` : The resource could not be found. + /// - `ResourceQuotaExceededFault` : The quota for this resource quota has been exceeded. + public func createDataMigration(input: CreateDataMigrationInput) async throws -> CreateDataMigrationOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "createDataMigration") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "dms") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(CreateDataMigrationInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(CreateDataMigrationOutput.httpOutput(from:), CreateDataMigrationOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.interceptors.add(AWSClientRuntime.XAmzTargetMiddleware(xAmzTarget: "AmazonDMSv20160101.CreateDataMigration")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: CreateDataMigrationInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/x-amz-json-1.1")) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "DatabaseMigration") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "CreateDataMigration") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + /// Performs the `CreateDataProvider` operation on the `AmazonDMSv20160101` service. /// /// Creates a data provider using the provided settings. A data provider stores a data store type and location information about your database. @@ -490,6 +565,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `ResourceAlreadyExistsFault` : The resource you are attempting to create already exists. /// - `ResourceQuotaExceededFault` : The quota for this resource quota has been exceeded. public func createDataProvider(input: CreateDataProviderInput) async throws -> CreateDataProviderOutput { @@ -791,6 +867,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. /// - `KMSKeyNotAccessibleFault` : DMS cannot access the KMS key. /// - `ResourceAlreadyExistsFault` : The resource you are attempting to create already exists. @@ -868,6 +945,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `ResourceAlreadyExistsFault` : The resource you are attempting to create already exists. /// - `ResourceNotFoundFault` : The resource could not be found. /// - `ResourceQuotaExceededFault` : The quota for this resource quota has been exceeded. @@ -1380,6 +1458,78 @@ extension DatabaseMigrationClient { return try await op.execute(input: input) } + /// Performs the `DeleteDataMigration` operation on the `AmazonDMSv20160101` service. + /// + /// Deletes the specified data migration. + /// + /// - Parameter DeleteDataMigrationInput : [no documentation found] + /// + /// - Returns: `DeleteDataMigrationOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `FailedDependencyFault` : A dependency threw an exception. + /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. + /// - `ResourceNotFoundFault` : The resource could not be found. + public func deleteDataMigration(input: DeleteDataMigrationInput) async throws -> DeleteDataMigrationOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "deleteDataMigration") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "dms") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(DeleteDataMigrationInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(DeleteDataMigrationOutput.httpOutput(from:), DeleteDataMigrationOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.interceptors.add(AWSClientRuntime.XAmzTargetMiddleware(xAmzTarget: "AmazonDMSv20160101.DeleteDataMigration")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: DeleteDataMigrationInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/x-amz-json-1.1")) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "DatabaseMigration") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "DeleteDataMigration") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + /// Performs the `DeleteDataProvider` operation on the `AmazonDMSv20160101` service. /// /// Deletes the specified data provider. All migration projects associated with the data provider must be deleted or modified before you can delete the data provider. @@ -1392,6 +1542,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. /// - `ResourceNotFoundFault` : The resource could not be found. public func deleteDataProvider(input: DeleteDataProviderInput) async throws -> DeleteDataProviderOutput { @@ -1605,6 +1756,7 @@ extension DatabaseMigrationClient { /// - Throws: One of the exceptions listed below __Possible Exceptions__. /// /// __Possible Exceptions:__ + /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. /// - `CollectorNotFoundFault` : The specified collector doesn't exist. /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. public func deleteFleetAdvisorCollector(input: DeleteFleetAdvisorCollectorInput) async throws -> DeleteFleetAdvisorCollectorOutput { @@ -1676,6 +1828,7 @@ extension DatabaseMigrationClient { /// - Throws: One of the exceptions listed below __Possible Exceptions__. /// /// __Possible Exceptions:__ + /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. /// - `InvalidOperationFault` : The action or operation requested isn't valid. /// - `ResourceNotFoundFault` : The resource could not be found. public func deleteFleetAdvisorDatabases(input: DeleteFleetAdvisorDatabasesInput) async throws -> DeleteFleetAdvisorDatabasesOutput { @@ -1748,6 +1901,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. /// - `ResourceNotFoundFault` : The resource could not be found. public func deleteInstanceProfile(input: DeleteInstanceProfileInput) async throws -> DeleteInstanceProfileOutput { @@ -1820,6 +1974,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. /// - `ResourceNotFoundFault` : The resource could not be found. public func deleteMigrationProject(input: DeleteMigrationProjectInput) async throws -> DeleteMigrationProjectOutput { @@ -2584,6 +2739,78 @@ extension DatabaseMigrationClient { return try await op.execute(input: input) } + /// Performs the `DescribeDataMigrations` operation on the `AmazonDMSv20160101` service. + /// + /// Returns information about data migrations. + /// + /// - Parameter DescribeDataMigrationsInput : [no documentation found] + /// + /// - Returns: `DescribeDataMigrationsOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `FailedDependencyFault` : A dependency threw an exception. + /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. + /// - `ResourceNotFoundFault` : The resource could not be found. + public func describeDataMigrations(input: DescribeDataMigrationsInput) async throws -> DescribeDataMigrationsOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "describeDataMigrations") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "dms") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(DescribeDataMigrationsInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(DescribeDataMigrationsOutput.httpOutput(from:), DescribeDataMigrationsOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.interceptors.add(AWSClientRuntime.XAmzTargetMiddleware(xAmzTarget: "AmazonDMSv20160101.DescribeDataMigrations")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: DescribeDataMigrationsInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/x-amz-json-1.1")) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "DatabaseMigration") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "DescribeDataMigrations") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + /// Performs the `DescribeDataProviders` operation on the `AmazonDMSv20160101` service. /// /// Returns a paginated list of data providers for your account in the current region. @@ -2596,6 +2823,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `ResourceNotFoundFault` : The resource could not be found. public func describeDataProviders(input: DescribeDataProvidersInput) async throws -> DescribeDataProvidersOutput { let context = Smithy.ContextBuilder() @@ -3547,6 +3775,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `ResourceNotFoundFault` : The resource could not be found. public func describeInstanceProfiles(input: DescribeInstanceProfilesInput) async throws -> DescribeInstanceProfilesOutput { let context = Smithy.ContextBuilder() @@ -3968,6 +4197,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `ResourceNotFoundFault` : The resource could not be found. public func describeMigrationProjects(input: DescribeMigrationProjectsInput) async throws -> DescribeMigrationProjectsOutput { let context = Smithy.ContextBuilder() @@ -5372,6 +5602,7 @@ extension DatabaseMigrationClient { /// - Throws: One of the exceptions listed below __Possible Exceptions__. /// /// __Possible Exceptions:__ + /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. /// - `ResourceNotFoundFault` : The resource could not be found. public func listTagsForResource(input: ListTagsForResourceInput) async throws -> ListTagsForResourceOutput { let context = Smithy.ContextBuilder() @@ -5502,6 +5733,78 @@ extension DatabaseMigrationClient { return try await op.execute(input: input) } + /// Performs the `ModifyDataMigration` operation on the `AmazonDMSv20160101` service. + /// + /// Modifies an existing DMS data migration. + /// + /// - Parameter ModifyDataMigrationInput : [no documentation found] + /// + /// - Returns: `ModifyDataMigrationOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `FailedDependencyFault` : A dependency threw an exception. + /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. + /// - `ResourceNotFoundFault` : The resource could not be found. + public func modifyDataMigration(input: ModifyDataMigrationInput) async throws -> ModifyDataMigrationOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "modifyDataMigration") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "dms") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(ModifyDataMigrationInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(ModifyDataMigrationOutput.httpOutput(from:), ModifyDataMigrationOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.interceptors.add(AWSClientRuntime.XAmzTargetMiddleware(xAmzTarget: "AmazonDMSv20160101.ModifyDataMigration")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: ModifyDataMigrationInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/x-amz-json-1.1")) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "DatabaseMigration") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "ModifyDataMigration") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + /// Performs the `ModifyDataProvider` operation on the `AmazonDMSv20160101` service. /// /// Modifies the specified data provider using the provided settings. You must remove the data provider from all migration projects before you can modify it. @@ -5514,6 +5817,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. /// - `ResourceNotFoundFault` : The resource could not be found. public func modifyDataProvider(input: ModifyDataProviderInput) async throws -> ModifyDataProviderOutput { @@ -5738,6 +6042,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. /// - `KMSKeyNotAccessibleFault` : DMS cannot access the KMS key. /// - `ResourceNotFoundFault` : The resource could not be found. @@ -5813,6 +6118,7 @@ extension DatabaseMigrationClient { /// /// __Possible Exceptions:__ /// - `AccessDeniedFault` : DMS was denied access to the endpoint. Check that the role is correctly configured. + /// - `FailedDependencyFault` : A dependency threw an exception. /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. /// - `ResourceNotFoundFault` : The resource could not be found. /// - `S3AccessDeniedFault` : Insufficient privileges are preventing access to an Amazon S3 object. @@ -6545,6 +6851,7 @@ extension DatabaseMigrationClient { /// - Throws: One of the exceptions listed below __Possible Exceptions__. /// /// __Possible Exceptions:__ + /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. /// - `ResourceNotFoundFault` : The resource could not be found. public func removeTagsFromResource(input: RemoveTagsFromResourceInput) async throws -> RemoveTagsFromResourceOutput { let context = Smithy.ContextBuilder() @@ -6675,6 +6982,80 @@ extension DatabaseMigrationClient { return try await op.execute(input: input) } + /// Performs the `StartDataMigration` operation on the `AmazonDMSv20160101` service. + /// + /// Starts the specified data migration. + /// + /// - Parameter StartDataMigrationInput : [no documentation found] + /// + /// - Returns: `StartDataMigrationOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `FailedDependencyFault` : A dependency threw an exception. + /// - `InvalidOperationFault` : The action or operation requested isn't valid. + /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. + /// - `ResourceNotFoundFault` : The resource could not be found. + /// - `ResourceQuotaExceededFault` : The quota for this resource quota has been exceeded. + public func startDataMigration(input: StartDataMigrationInput) async throws -> StartDataMigrationOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "startDataMigration") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "dms") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(StartDataMigrationInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(StartDataMigrationOutput.httpOutput(from:), StartDataMigrationOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.interceptors.add(AWSClientRuntime.XAmzTargetMiddleware(xAmzTarget: "AmazonDMSv20160101.StartDataMigration")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: StartDataMigrationInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/x-amz-json-1.1")) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "DatabaseMigration") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "StartDataMigration") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + /// Performs the `StartExtensionPackAssociation` operation on the `AmazonDMSv20160101` service. /// /// Applies the extension pack to your target database. An extension pack is an add-on module that emulates functions present in a source database that are required when converting objects to the target database. @@ -7512,6 +7893,78 @@ extension DatabaseMigrationClient { return try await op.execute(input: input) } + /// Performs the `StopDataMigration` operation on the `AmazonDMSv20160101` service. + /// + /// Stops the specified data migration. + /// + /// - Parameter StopDataMigrationInput : [no documentation found] + /// + /// - Returns: `StopDataMigrationOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `FailedDependencyFault` : A dependency threw an exception. + /// - `InvalidResourceStateFault` : The resource is in a state that prevents it from being used for database migration. + /// - `ResourceNotFoundFault` : The resource could not be found. + public func stopDataMigration(input: StopDataMigrationInput) async throws -> StopDataMigrationOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "stopDataMigration") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "dms") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(StopDataMigrationInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(StopDataMigrationOutput.httpOutput(from:), StopDataMigrationOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.interceptors.add(AWSClientRuntime.XAmzTargetMiddleware(xAmzTarget: "AmazonDMSv20160101.StopDataMigration")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: StopDataMigrationInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/x-amz-json-1.1")) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "DatabaseMigration") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "StopDataMigration") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + /// Performs the `StopReplication` operation on the `AmazonDMSv20160101` service. /// /// For a given DMS Serverless replication configuration, DMS stops any and all ongoing DMS Serverless replications. This command doesn't deprovision the stopped replications. diff --git a/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/Models.swift b/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/Models.swift index 76490256c9b..8d2d3f1c65a 100644 --- a/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/Models.swift +++ b/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/Models.swift @@ -91,6 +91,31 @@ extension DatabaseMigrationClientTypes { } } +/// The resource is in a state that prevents it from being used for database migration. +public struct InvalidResourceStateFault: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { + + public struct Properties { + /// + public internal(set) var message: Swift.String? = nil + } + + public internal(set) var properties = Properties() + public static var typeName: Swift.String { "InvalidResourceStateFault" } + public static var fault: ClientRuntime.ErrorFault { .client } + public static var isRetryable: Swift.Bool { false } + public static var isThrottling: Swift.Bool { false } + public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() + public internal(set) var message: Swift.String? + public internal(set) var requestID: Swift.String? + + public init( + message: Swift.String? = nil + ) + { + self.properties.message = message + } +} + /// The resource could not be found. public struct ResourceNotFoundFault: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { @@ -270,31 +295,6 @@ public struct ApplyPendingMaintenanceActionOutput: Swift.Sendable { } } -/// The resource is in a state that prevents it from being used for database migration. -public struct InvalidResourceStateFault: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { - - public struct Properties { - /// - public internal(set) var message: Swift.String? = nil - } - - public internal(set) var properties = Properties() - public static var typeName: Swift.String { "InvalidResourceStateFault" } - public static var fault: ClientRuntime.ErrorFault { .client } - public static var isRetryable: Swift.Bool { false } - public static var isThrottling: Swift.Bool { false } - public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() - public internal(set) var message: Swift.String? - public internal(set) var requestID: Swift.String? - - public init( - message: Swift.String? = nil - ) - { - self.properties.message = message - } -} - extension DatabaseMigrationClientTypes { /// Provides information about the required target engine settings. @@ -514,6 +514,54 @@ public struct CancelReplicationTaskAssessmentRunOutput: Swift.Sendable { } } +/// A dependency threw an exception. +public struct FailedDependencyFault: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { + + public struct Properties { + public internal(set) var message: Swift.String? = nil + } + + public internal(set) var properties = Properties() + public static var typeName: Swift.String { "FailedDependencyFault" } + public static var fault: ClientRuntime.ErrorFault { .client } + public static var isRetryable: Swift.Bool { false } + public static var isThrottling: Swift.Bool { false } + public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() + public internal(set) var message: Swift.String? + public internal(set) var requestID: Swift.String? + + public init( + message: Swift.String? = nil + ) + { + self.properties.message = message + } +} + +/// The action or operation requested isn't valid. +public struct InvalidOperationFault: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { + + public struct Properties { + public internal(set) var message: Swift.String? = nil + } + + public internal(set) var properties = Properties() + public static var typeName: Swift.String { "InvalidOperationFault" } + public static var fault: ClientRuntime.ErrorFault { .client } + public static var isRetryable: Swift.Bool { false } + public static var isThrottling: Swift.Bool { false } + public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() + public internal(set) var message: Swift.String? + public internal(set) var requestID: Swift.String? + + public init( + message: Swift.String? = nil + ) + { + self.properties.message = message + } +} + /// The resource you are attempting to create already exists. public struct ResourceAlreadyExistsFault: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { @@ -568,6 +616,290 @@ public struct ResourceQuotaExceededFault: ClientRuntime.ModeledError, AWSClientR } } +extension DatabaseMigrationClientTypes { + + public enum MigrationTypeValue: Swift.Sendable, Swift.Equatable, Swift.RawRepresentable, Swift.CaseIterable, Swift.Hashable { + case cdc + case fullLoad + case fullLoadAndCdc + case sdkUnknown(Swift.String) + + public static var allCases: [MigrationTypeValue] { + return [ + .cdc, + .fullLoad, + .fullLoadAndCdc + ] + } + + public init?(rawValue: Swift.String) { + let value = Self.allCases.first(where: { $0.rawValue == rawValue }) + self = value ?? Self.sdkUnknown(rawValue) + } + + public var rawValue: Swift.String { + switch self { + case .cdc: return "cdc" + case .fullLoad: return "full-load" + case .fullLoadAndCdc: return "full-load-and-cdc" + case let .sdkUnknown(s): return s + } + } + } +} + +extension DatabaseMigrationClientTypes { + + /// Defines settings for a source data provider for a data migration. + public struct SourceDataSetting: Swift.Sendable { + /// The change data capture (CDC) start position for the source data provider. + public var cdcStartPosition: Swift.String? + /// The change data capture (CDC) start time for the source data provider. + public var cdcStartTime: Foundation.Date? + /// The change data capture (CDC) stop time for the source data provider. + public var cdcStopTime: Foundation.Date? + /// The name of the replication slot on the source data provider. This attribute is only valid for a PostgreSQL or Aurora PostgreSQL source. + public var slotName: Swift.String? + + public init( + cdcStartPosition: Swift.String? = nil, + cdcStartTime: Foundation.Date? = nil, + cdcStopTime: Foundation.Date? = nil, + slotName: Swift.String? = nil + ) + { + self.cdcStartPosition = cdcStartPosition + self.cdcStartTime = cdcStartTime + self.cdcStopTime = cdcStopTime + self.slotName = slotName + } + } +} + +public struct CreateDataMigrationInput: Swift.Sendable { + /// A user-friendly name for the data migration. Data migration names have the following constraints: + /// + /// * Must begin with a letter, and can only contain ASCII letters, digits, and hyphens. + /// + /// * Can't end with a hyphen or contain two consecutive hyphens. + /// + /// * Length must be from 1 to 255 characters. + public var dataMigrationName: Swift.String? + /// Specifies if the data migration is full-load only, change data capture (CDC) only, or full-load and CDC. + /// This member is required. + public var dataMigrationType: DatabaseMigrationClientTypes.MigrationTypeValue? + /// Specifies whether to enable CloudWatch logs for the data migration. + public var enableCloudwatchLogs: Swift.Bool? + /// An identifier for the migration project. + /// This member is required. + public var migrationProjectIdentifier: Swift.String? + /// The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target. + public var numberOfJobs: Swift.Int? + /// An optional JSON string specifying what tables, views, and schemas to include or exclude from the migration. + public var selectionRules: Swift.String? + /// The Amazon Resource Name (ARN) for the service access role that you want to use to create the data migration. + /// This member is required. + public var serviceAccessRoleArn: Swift.String? + /// Specifies information about the source data provider. + public var sourceDataSettings: [DatabaseMigrationClientTypes.SourceDataSetting]? + /// One or more tags to be assigned to the data migration. + public var tags: [DatabaseMigrationClientTypes.Tag]? + + public init( + dataMigrationName: Swift.String? = nil, + dataMigrationType: DatabaseMigrationClientTypes.MigrationTypeValue? = nil, + enableCloudwatchLogs: Swift.Bool? = nil, + migrationProjectIdentifier: Swift.String? = nil, + numberOfJobs: Swift.Int? = nil, + selectionRules: Swift.String? = nil, + serviceAccessRoleArn: Swift.String? = nil, + sourceDataSettings: [DatabaseMigrationClientTypes.SourceDataSetting]? = nil, + tags: [DatabaseMigrationClientTypes.Tag]? = nil + ) + { + self.dataMigrationName = dataMigrationName + self.dataMigrationType = dataMigrationType + self.enableCloudwatchLogs = enableCloudwatchLogs + self.migrationProjectIdentifier = migrationProjectIdentifier + self.numberOfJobs = numberOfJobs + self.selectionRules = selectionRules + self.serviceAccessRoleArn = serviceAccessRoleArn + self.sourceDataSettings = sourceDataSettings + self.tags = tags + } +} + +extension CreateDataMigrationInput: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "CreateDataMigrationInput(dataMigrationName: \(Swift.String(describing: dataMigrationName)), dataMigrationType: \(Swift.String(describing: dataMigrationType)), enableCloudwatchLogs: \(Swift.String(describing: enableCloudwatchLogs)), migrationProjectIdentifier: \(Swift.String(describing: migrationProjectIdentifier)), numberOfJobs: \(Swift.String(describing: numberOfJobs)), serviceAccessRoleArn: \(Swift.String(describing: serviceAccessRoleArn)), sourceDataSettings: \(Swift.String(describing: sourceDataSettings)), tags: \(Swift.String(describing: tags)), selectionRules: \"CONTENT_REDACTED\")"} +} + +extension DatabaseMigrationClientTypes { + + /// Options for configuring a data migration, including whether to enable CloudWatch logs, and the selection rules to use to include or exclude database objects from the migration. + public struct DataMigrationSettings: Swift.Sendable { + /// Whether to enable CloudWatch logging for the data migration. + public var cloudwatchLogsEnabled: Swift.Bool? + /// The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target. + public var numberOfJobs: Swift.Int? + /// A JSON-formatted string that defines what objects to include and exclude from the migration. + public var selectionRules: Swift.String? + + public init( + cloudwatchLogsEnabled: Swift.Bool? = nil, + numberOfJobs: Swift.Int? = nil, + selectionRules: Swift.String? = nil + ) + { + self.cloudwatchLogsEnabled = cloudwatchLogsEnabled + self.numberOfJobs = numberOfJobs + self.selectionRules = selectionRules + } + } +} + +extension DatabaseMigrationClientTypes.DataMigrationSettings: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "DataMigrationSettings(cloudwatchLogsEnabled: \(Swift.String(describing: cloudwatchLogsEnabled)), numberOfJobs: \(Swift.String(describing: numberOfJobs)), selectionRules: \"CONTENT_REDACTED\")"} +} + +extension DatabaseMigrationClientTypes { + + /// Information about the data migration run, including start and stop time, latency, and migration progress. + public struct DataMigrationStatistics: Swift.Sendable { + /// The current latency of the change data capture (CDC) operation. + public var cdcLatency: Swift.Int + /// The elapsed duration of the data migration run. + public var elapsedTimeMillis: Swift.Int + /// The data migration's progress in the full-load migration phase. + public var fullLoadPercentage: Swift.Int + /// The time when the migration started. + public var startTime: Foundation.Date? + /// The time when the migration stopped or failed. + public var stopTime: Foundation.Date? + /// The number of tables that DMS failed to process. + public var tablesErrored: Swift.Int + /// The number of tables loaded in the current data migration run. + public var tablesLoaded: Swift.Int + /// The data migration's table loading progress. + public var tablesLoading: Swift.Int + /// The number of tables that are waiting for processing. + public var tablesQueued: Swift.Int + + public init( + cdcLatency: Swift.Int = 0, + elapsedTimeMillis: Swift.Int = 0, + fullLoadPercentage: Swift.Int = 0, + startTime: Foundation.Date? = nil, + stopTime: Foundation.Date? = nil, + tablesErrored: Swift.Int = 0, + tablesLoaded: Swift.Int = 0, + tablesLoading: Swift.Int = 0, + tablesQueued: Swift.Int = 0 + ) + { + self.cdcLatency = cdcLatency + self.elapsedTimeMillis = elapsedTimeMillis + self.fullLoadPercentage = fullLoadPercentage + self.startTime = startTime + self.stopTime = stopTime + self.tablesErrored = tablesErrored + self.tablesLoaded = tablesLoaded + self.tablesLoading = tablesLoading + self.tablesQueued = tablesQueued + } + } +} + +extension DatabaseMigrationClientTypes { + + /// This object provides information about a DMS data migration. + public struct DataMigration: Swift.Sendable { + /// The Amazon Resource Name (ARN) that identifies this replication. + public var dataMigrationArn: Swift.String? + /// The UTC time when DMS created the data migration. + public var dataMigrationCreateTime: Foundation.Date? + /// The UTC time when data migration ended. + public var dataMigrationEndTime: Foundation.Date? + /// The user-friendly name for the data migration. + public var dataMigrationName: Swift.String? + /// Specifies CloudWatch settings and selection rules for the data migration. + public var dataMigrationSettings: DatabaseMigrationClientTypes.DataMigrationSettings? + /// The UTC time when DMS started the data migration. + public var dataMigrationStartTime: Foundation.Date? + /// Provides information about the data migration's run, including start and stop time, latency, and data migration progress. + public var dataMigrationStatistics: DatabaseMigrationClientTypes.DataMigrationStatistics? + /// The current status of the data migration. + public var dataMigrationStatus: Swift.String? + /// Specifies whether the data migration is full-load only, change data capture (CDC) only, or full-load and CDC. + public var dataMigrationType: DatabaseMigrationClientTypes.MigrationTypeValue? + /// Information about the data migration's most recent error or failure. + public var lastFailureMessage: Swift.String? + /// The Amazon Resource Name (ARN) of the data migration's associated migration project. + public var migrationProjectArn: Swift.String? + /// The IP addresses of the endpoints for the data migration. + public var publicIpAddresses: [Swift.String]? + /// The IAM role that the data migration uses to access Amazon Web Services resources. + public var serviceAccessRoleArn: Swift.String? + /// Specifies information about the data migration's source data provider. + public var sourceDataSettings: [DatabaseMigrationClientTypes.SourceDataSetting]? + /// The reason the data migration last stopped. + public var stopReason: Swift.String? + + public init( + dataMigrationArn: Swift.String? = nil, + dataMigrationCreateTime: Foundation.Date? = nil, + dataMigrationEndTime: Foundation.Date? = nil, + dataMigrationName: Swift.String? = nil, + dataMigrationSettings: DatabaseMigrationClientTypes.DataMigrationSettings? = nil, + dataMigrationStartTime: Foundation.Date? = nil, + dataMigrationStatistics: DatabaseMigrationClientTypes.DataMigrationStatistics? = nil, + dataMigrationStatus: Swift.String? = nil, + dataMigrationType: DatabaseMigrationClientTypes.MigrationTypeValue? = nil, + lastFailureMessage: Swift.String? = nil, + migrationProjectArn: Swift.String? = nil, + publicIpAddresses: [Swift.String]? = nil, + serviceAccessRoleArn: Swift.String? = nil, + sourceDataSettings: [DatabaseMigrationClientTypes.SourceDataSetting]? = nil, + stopReason: Swift.String? = nil + ) + { + self.dataMigrationArn = dataMigrationArn + self.dataMigrationCreateTime = dataMigrationCreateTime + self.dataMigrationEndTime = dataMigrationEndTime + self.dataMigrationName = dataMigrationName + self.dataMigrationSettings = dataMigrationSettings + self.dataMigrationStartTime = dataMigrationStartTime + self.dataMigrationStatistics = dataMigrationStatistics + self.dataMigrationStatus = dataMigrationStatus + self.dataMigrationType = dataMigrationType + self.lastFailureMessage = lastFailureMessage + self.migrationProjectArn = migrationProjectArn + self.publicIpAddresses = publicIpAddresses + self.serviceAccessRoleArn = serviceAccessRoleArn + self.sourceDataSettings = sourceDataSettings + self.stopReason = stopReason + } + } +} + +extension DatabaseMigrationClientTypes.DataMigration: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "DataMigration(dataMigrationArn: \(Swift.String(describing: dataMigrationArn)), dataMigrationCreateTime: \(Swift.String(describing: dataMigrationCreateTime)), dataMigrationEndTime: \(Swift.String(describing: dataMigrationEndTime)), dataMigrationName: \(Swift.String(describing: dataMigrationName)), dataMigrationSettings: \(Swift.String(describing: dataMigrationSettings)), dataMigrationStartTime: \(Swift.String(describing: dataMigrationStartTime)), dataMigrationStatistics: \(Swift.String(describing: dataMigrationStatistics)), dataMigrationStatus: \(Swift.String(describing: dataMigrationStatus)), dataMigrationType: \(Swift.String(describing: dataMigrationType)), lastFailureMessage: \(Swift.String(describing: lastFailureMessage)), migrationProjectArn: \(Swift.String(describing: migrationProjectArn)), serviceAccessRoleArn: \(Swift.String(describing: serviceAccessRoleArn)), sourceDataSettings: \(Swift.String(describing: sourceDataSettings)), stopReason: \(Swift.String(describing: stopReason)), publicIpAddresses: \"CONTENT_REDACTED\")"} +} + +public struct CreateDataMigrationOutput: Swift.Sendable { + /// Information about the created data migration. + public var dataMigration: DatabaseMigrationClientTypes.DataMigration? + + public init( + dataMigration: DatabaseMigrationClientTypes.DataMigration? = nil + ) + { + self.dataMigration = dataMigration + } +} + extension DatabaseMigrationClientTypes { public enum DmsSslModeValue: Swift.Sendable, Swift.Equatable, Swift.RawRepresentable, Swift.CaseIterable, Swift.Hashable { @@ -3350,7 +3682,7 @@ public struct CreateEndpointInput: Swift.Sendable { /// The type of endpoint. Valid values are source and target. /// This member is required. public var endpointType: DatabaseMigrationClientTypes.ReplicationEndpointTypeValue? - /// The type of engine for the endpoint. Valid values, depending on the EndpointType value, include "mysql", "oracle", "postgres", "mariadb", "aurora", "aurora-postgresql", "opensearch", "redshift", "s3", "db2", "db2-zos", "azuredb", "sybase", "dynamodb", "mongodb", "kinesis", "kafka", "elasticsearch", "docdb", "sqlserver", "neptune", and "babelfish". + /// The type of engine for the endpoint. Valid values, depending on the EndpointType value, include "mysql", "oracle", "postgres", "mariadb", "aurora", "aurora-postgresql", "opensearch", "redshift", "s3", "db2", "db2-zos", "azuredb", "sybase", "dynamodb", "mongodb", "kinesis", "kafka", "elasticsearch", "docdb", "sqlserver", "neptune", "babelfish", redshift-serverless, aurora-serverless, aurora-postgresql-serverless, gcp-mysql, azure-sql-managed-instance, redis, dms-transfer. /// This member is required. public var engineName: Swift.String? /// The external table definition. @@ -4361,7 +4693,7 @@ extension DatabaseMigrationClientTypes { public var kmsKeyId: Swift.String? /// Specifies the maximum value of the DMS capacity units (DCUs) for which a given DMS Serverless replication can be provisioned. A single DCU is 2GB of RAM, with 1 DCU as the minimum value allowed. The list of valid DCU values includes 1, 2, 4, 8, 16, 32, 64, 128, 192, 256, and 384. So, the maximum value that you can specify for DMS Serverless is 384. The MaxCapacityUnits parameter is the only DCU parameter you are required to specify. public var maxCapacityUnits: Swift.Int? - /// Specifies the minimum value of the DMS capacity units (DCUs) for which a given DMS Serverless replication can be provisioned. A single DCU is 2GB of RAM, with 1 DCU as the minimum value allowed. The list of valid DCU values includes 1, 2, 4, 8, 16, 32, 64, 128, 192, 256, and 384. So, the minimum DCU value that you can specify for DMS Serverless is 1. You don't have to specify a value for the MinCapacityUnits parameter. If you don't set this value, DMS scans the current activity of available source tables to identify an optimum setting for this parameter. If there is no current source activity or DMS can't otherwise identify a more appropriate value, it sets this parameter to the minimum DCU value allowed, 1. + /// Specifies the minimum value of the DMS capacity units (DCUs) for which a given DMS Serverless replication can be provisioned. A single DCU is 2GB of RAM, with 1 DCU as the minimum value allowed. The list of valid DCU values includes 1, 2, 4, 8, 16, 32, 64, 128, 192, 256, and 384. So, the minimum DCU value that you can specify for DMS Serverless is 1. If you don't set this value, DMS sets this parameter to the minimum DCU value allowed, 1. If there is no current source activity, DMS scales down your replication until it reaches the value specified in MinCapacityUnits. public var minCapacityUnits: Swift.Int? /// Specifies whether the DMS Serverless replication is a Multi-AZ deployment. You can't set the AvailabilityZone parameter if the MultiAZ parameter is set to true. public var multiAZ: Swift.Bool? @@ -4397,38 +4729,6 @@ extension DatabaseMigrationClientTypes { } } -extension DatabaseMigrationClientTypes { - - public enum MigrationTypeValue: Swift.Sendable, Swift.Equatable, Swift.RawRepresentable, Swift.CaseIterable, Swift.Hashable { - case cdc - case fullLoad - case fullLoadAndCdc - case sdkUnknown(Swift.String) - - public static var allCases: [MigrationTypeValue] { - return [ - .cdc, - .fullLoad, - .fullLoadAndCdc - ] - } - - public init?(rawValue: Swift.String) { - let value = Self.allCases.first(where: { $0.rawValue == rawValue }) - self = value ?? Self.sdkUnknown(rawValue) - } - - public var rawValue: Swift.String { - switch self { - case .cdc: return "cdc" - case .fullLoad: return "full-load" - case .fullLoadAndCdc: return "full-load-and-cdc" - case let .sdkUnknown(s): return s - } - } - } -} - /// public struct CreateReplicationConfigInput: Swift.Sendable { /// Configuration parameters for provisioning an DMS Serverless replication. @@ -4988,7 +5288,7 @@ public struct CreateReplicationSubnetGroupInput: Swift.Sendable { /// The description for the subnet group. /// This member is required. public var replicationSubnetGroupDescription: Swift.String? - /// The name for the replication subnet group. This value is stored as a lowercase string. Constraints: Must contain no more than 255 alphanumeric characters, periods, spaces, underscores, or hyphens. Must not be "default". Example: mySubnetgroup + /// The name for the replication subnet group. This value is stored as a lowercase string. Constraints: Must contain no more than 255 alphanumeric characters, periods, underscores, or hyphens. Must not be "default". Example: mySubnetgroup /// This member is required. public var replicationSubnetGroupIdentifier: Swift.String? /// Two or more subnet IDs to be assigned to the subnet group. @@ -5465,6 +5765,31 @@ public struct DeleteConnectionOutput: Swift.Sendable { } } +public struct DeleteDataMigrationInput: Swift.Sendable { + /// The identifier (name or ARN) of the data migration to delete. + /// This member is required. + public var dataMigrationIdentifier: Swift.String? + + public init( + dataMigrationIdentifier: Swift.String? = nil + ) + { + self.dataMigrationIdentifier = dataMigrationIdentifier + } +} + +public struct DeleteDataMigrationOutput: Swift.Sendable { + /// The deleted data migration. + public var dataMigration: DatabaseMigrationClientTypes.DataMigration? + + public init( + dataMigration: DatabaseMigrationClientTypes.DataMigration? = nil + ) + { + self.dataMigration = dataMigration + } +} + public struct DeleteDataProviderInput: Swift.Sendable { /// The identifier of the data provider to delete. /// This member is required. @@ -5581,30 +5906,6 @@ public struct DeleteFleetAdvisorCollectorInput: Swift.Sendable { } } -/// The action or operation requested isn't valid. -public struct InvalidOperationFault: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { - - public struct Properties { - public internal(set) var message: Swift.String? = nil - } - - public internal(set) var properties = Properties() - public static var typeName: Swift.String { "InvalidOperationFault" } - public static var fault: ClientRuntime.ErrorFault { .client } - public static var isRetryable: Swift.Bool { false } - public static var isThrottling: Swift.Bool { false } - public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() - public internal(set) var message: Swift.String? - public internal(set) var requestID: Swift.String? - - public init( - message: Swift.String? = nil - ) - { - self.properties.message = message - } -} - public struct DeleteFleetAdvisorDatabasesInput: Swift.Sendable { /// The IDs of the Fleet Advisor collector databases to delete. /// This member is required. @@ -6010,6 +6311,50 @@ public struct DescribeConversionConfigurationOutput: Swift.Sendable { } } +public struct DescribeDataMigrationsInput: Swift.Sendable { + /// Filters applied to the data migrations. + public var filters: [DatabaseMigrationClientTypes.Filter]? + /// An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords. + public var marker: Swift.String? + /// The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a pagination token called a marker is included in the response so that the remaining results can be retrieved. + public var maxRecords: Swift.Int? + /// An option to set to avoid returning information about settings. Use this to reduce overhead when setting information is too large. To use this option, choose true; otherwise, choose false (the default). + public var withoutSettings: Swift.Bool? + /// An option to set to avoid returning information about statistics. Use this to reduce overhead when statistics information is too large. To use this option, choose true; otherwise, choose false (the default). + public var withoutStatistics: Swift.Bool? + + public init( + filters: [DatabaseMigrationClientTypes.Filter]? = nil, + marker: Swift.String? = nil, + maxRecords: Swift.Int? = nil, + withoutSettings: Swift.Bool? = nil, + withoutStatistics: Swift.Bool? = nil + ) + { + self.filters = filters + self.marker = marker + self.maxRecords = maxRecords + self.withoutSettings = withoutSettings + self.withoutStatistics = withoutStatistics + } +} + +public struct DescribeDataMigrationsOutput: Swift.Sendable { + /// Returns information about the data migrations used in the project. + public var dataMigrations: [DatabaseMigrationClientTypes.DataMigration]? + /// An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords. + public var marker: Swift.String? + + public init( + dataMigrations: [DatabaseMigrationClientTypes.DataMigration]? = nil, + marker: Swift.String? = nil + ) + { + self.dataMigrations = dataMigrations + self.marker = marker + } +} + public struct DescribeDataProvidersInput: Swift.Sendable { /// Filters applied to the data providers described in the form of key-value pairs. Valid filter names: data-provider-identifier public var filters: [DatabaseMigrationClientTypes.Filter]? @@ -9308,6 +9653,64 @@ public struct ModifyConversionConfigurationOutput: Swift.Sendable { } } +public struct ModifyDataMigrationInput: Swift.Sendable { + /// The identifier (name or ARN) of the data migration to modify. + /// This member is required. + public var dataMigrationIdentifier: Swift.String? + /// The new name for the data migration. + public var dataMigrationName: Swift.String? + /// The new migration type for the data migration. + public var dataMigrationType: DatabaseMigrationClientTypes.MigrationTypeValue? + /// Whether to enable Cloudwatch logs for the data migration. + public var enableCloudwatchLogs: Swift.Bool? + /// The number of parallel jobs that trigger parallel threads to unload the tables from the source, and then load them to the target. + public var numberOfJobs: Swift.Int? + /// A JSON-formatted string that defines what objects to include and exclude from the migration. + public var selectionRules: Swift.String? + /// The new service access role ARN for the data migration. + public var serviceAccessRoleArn: Swift.String? + /// The new information about the source data provider for the data migration. + public var sourceDataSettings: [DatabaseMigrationClientTypes.SourceDataSetting]? + + public init( + dataMigrationIdentifier: Swift.String? = nil, + dataMigrationName: Swift.String? = nil, + dataMigrationType: DatabaseMigrationClientTypes.MigrationTypeValue? = nil, + enableCloudwatchLogs: Swift.Bool? = nil, + numberOfJobs: Swift.Int? = nil, + selectionRules: Swift.String? = nil, + serviceAccessRoleArn: Swift.String? = nil, + sourceDataSettings: [DatabaseMigrationClientTypes.SourceDataSetting]? = nil + ) + { + self.dataMigrationIdentifier = dataMigrationIdentifier + self.dataMigrationName = dataMigrationName + self.dataMigrationType = dataMigrationType + self.enableCloudwatchLogs = enableCloudwatchLogs + self.numberOfJobs = numberOfJobs + self.selectionRules = selectionRules + self.serviceAccessRoleArn = serviceAccessRoleArn + self.sourceDataSettings = sourceDataSettings + } +} + +extension ModifyDataMigrationInput: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "ModifyDataMigrationInput(dataMigrationIdentifier: \(Swift.String(describing: dataMigrationIdentifier)), dataMigrationName: \(Swift.String(describing: dataMigrationName)), dataMigrationType: \(Swift.String(describing: dataMigrationType)), enableCloudwatchLogs: \(Swift.String(describing: enableCloudwatchLogs)), numberOfJobs: \(Swift.String(describing: numberOfJobs)), serviceAccessRoleArn: \(Swift.String(describing: serviceAccessRoleArn)), sourceDataSettings: \(Swift.String(describing: sourceDataSettings)), selectionRules: \"CONTENT_REDACTED\")"} +} + +public struct ModifyDataMigrationOutput: Swift.Sendable { + /// Information about the modified data migration. + public var dataMigration: DatabaseMigrationClientTypes.DataMigration? + + public init( + dataMigration: DatabaseMigrationClientTypes.DataMigration? = nil + ) + { + self.dataMigration = dataMigration + } +} + public struct ModifyDataProviderInput: Swift.Sendable { /// The identifier of the data provider. Identifiers must begin with a letter and must contain only ASCII letters, digits, and hyphens. They can't end with a hyphen, or contain two consecutive hyphens. /// This member is required. @@ -10233,6 +10636,68 @@ public struct RunFleetAdvisorLsaAnalysisOutput: Swift.Sendable { } } +extension DatabaseMigrationClientTypes { + + public enum StartReplicationMigrationTypeValue: Swift.Sendable, Swift.Equatable, Swift.RawRepresentable, Swift.CaseIterable, Swift.Hashable { + case reloadTarget + case resumeProcessing + case startReplication + case sdkUnknown(Swift.String) + + public static var allCases: [StartReplicationMigrationTypeValue] { + return [ + .reloadTarget, + .resumeProcessing, + .startReplication + ] + } + + public init?(rawValue: Swift.String) { + let value = Self.allCases.first(where: { $0.rawValue == rawValue }) + self = value ?? Self.sdkUnknown(rawValue) + } + + public var rawValue: Swift.String { + switch self { + case .reloadTarget: return "reload-target" + case .resumeProcessing: return "resume-processing" + case .startReplication: return "start-replication" + case let .sdkUnknown(s): return s + } + } + } +} + +public struct StartDataMigrationInput: Swift.Sendable { + /// The identifier (name or ARN) of the data migration to start. + /// This member is required. + public var dataMigrationIdentifier: Swift.String? + /// Specifies the start type for the data migration. Valid values include start-replication, reload-target, and resume-processing. + /// This member is required. + public var startType: DatabaseMigrationClientTypes.StartReplicationMigrationTypeValue? + + public init( + dataMigrationIdentifier: Swift.String? = nil, + startType: DatabaseMigrationClientTypes.StartReplicationMigrationTypeValue? = nil + ) + { + self.dataMigrationIdentifier = dataMigrationIdentifier + self.startType = startType + } +} + +public struct StartDataMigrationOutput: Swift.Sendable { + /// The data migration that DMS started. + public var dataMigration: DatabaseMigrationClientTypes.DataMigration? + + public init( + dataMigration: DatabaseMigrationClientTypes.DataMigration? = nil + ) + { + self.dataMigration = dataMigration + } +} + public struct StartExtensionPackAssociationInput: Swift.Sendable { /// The migration project name or Amazon Resource Name (ARN). /// This member is required. @@ -10714,6 +11179,31 @@ public struct StartReplicationTaskAssessmentRunOutput: Swift.Sendable { } } +public struct StopDataMigrationInput: Swift.Sendable { + /// The identifier (name or ARN) of the data migration to stop. + /// This member is required. + public var dataMigrationIdentifier: Swift.String? + + public init( + dataMigrationIdentifier: Swift.String? = nil + ) + { + self.dataMigrationIdentifier = dataMigrationIdentifier + } +} + +public struct StopDataMigrationOutput: Swift.Sendable { + /// The data migration that DMS stopped. + public var dataMigration: DatabaseMigrationClientTypes.DataMigration? + + public init( + dataMigration: DatabaseMigrationClientTypes.DataMigration? = nil + ) + { + self.dataMigration = dataMigration + } +} + /// public struct StopReplicationInput: Swift.Sendable { /// The Amazon Resource Name of the replication to stop. @@ -10853,6 +11343,13 @@ extension CancelReplicationTaskAssessmentRunInput { } } +extension CreateDataMigrationInput { + + static func urlPathProvider(_ value: CreateDataMigrationInput) -> Swift.String? { + return "/" + } +} + extension CreateDataProviderInput { static func urlPathProvider(_ value: CreateDataProviderInput) -> Swift.String? { @@ -10937,6 +11434,13 @@ extension DeleteConnectionInput { } } +extension DeleteDataMigrationInput { + + static func urlPathProvider(_ value: DeleteDataMigrationInput) -> Swift.String? { + return "/" + } +} + extension DeleteDataProviderInput { static func urlPathProvider(_ value: DeleteDataProviderInput) -> Swift.String? { @@ -11056,6 +11560,13 @@ extension DescribeConversionConfigurationInput { } } +extension DescribeDataMigrationsInput { + + static func urlPathProvider(_ value: DescribeDataMigrationsInput) -> Swift.String? { + return "/" + } +} + extension DescribeDataProvidersInput { static func urlPathProvider(_ value: DescribeDataProvidersInput) -> Swift.String? { @@ -11350,6 +11861,13 @@ extension ModifyConversionConfigurationInput { } } +extension ModifyDataMigrationInput { + + static func urlPathProvider(_ value: ModifyDataMigrationInput) -> Swift.String? { + return "/" + } +} + extension ModifyDataProviderInput { static func urlPathProvider(_ value: ModifyDataProviderInput) -> Swift.String? { @@ -11462,6 +11980,13 @@ extension RunFleetAdvisorLsaAnalysisInput { } } +extension StartDataMigrationInput { + + static func urlPathProvider(_ value: StartDataMigrationInput) -> Swift.String? { + return "/" + } +} + extension StartExtensionPackAssociationInput { static func urlPathProvider(_ value: StartExtensionPackAssociationInput) -> Swift.String? { @@ -11539,6 +12064,13 @@ extension StartReplicationTaskAssessmentRunInput { } } +extension StopDataMigrationInput { + + static func urlPathProvider(_ value: StopDataMigrationInput) -> Swift.String? { + return "/" + } +} + extension StopReplicationInput { static func urlPathProvider(_ value: StopReplicationInput) -> Swift.String? { @@ -11602,6 +12134,22 @@ extension CancelReplicationTaskAssessmentRunInput { } } +extension CreateDataMigrationInput { + + static func write(value: CreateDataMigrationInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["DataMigrationName"].write(value.dataMigrationName) + try writer["DataMigrationType"].write(value.dataMigrationType) + try writer["EnableCloudwatchLogs"].write(value.enableCloudwatchLogs) + try writer["MigrationProjectIdentifier"].write(value.migrationProjectIdentifier) + try writer["NumberOfJobs"].write(value.numberOfJobs) + try writer["SelectionRules"].write(value.selectionRules) + try writer["ServiceAccessRoleArn"].write(value.serviceAccessRoleArn) + try writer["SourceDataSettings"].writeList(value.sourceDataSettings, memberWritingClosure: DatabaseMigrationClientTypes.SourceDataSetting.write(value:to:), memberNodeInfo: "member", isFlattened: false) + try writer["Tags"].writeList(value.tags, memberWritingClosure: DatabaseMigrationClientTypes.Tag.write(value:to:), memberNodeInfo: "member", isFlattened: false) + } +} + extension CreateDataProviderInput { static func write(value: CreateDataProviderInput?, to writer: SmithyJSON.Writer) throws { @@ -11795,8 +12343,16 @@ extension DeleteConnectionInput { static func write(value: DeleteConnectionInput?, to writer: SmithyJSON.Writer) throws { guard let value else { return } - try writer["EndpointArn"].write(value.endpointArn) - try writer["ReplicationInstanceArn"].write(value.replicationInstanceArn) + try writer["EndpointArn"].write(value.endpointArn) + try writer["ReplicationInstanceArn"].write(value.replicationInstanceArn) + } +} + +extension DeleteDataMigrationInput { + + static func write(value: DeleteDataMigrationInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["DataMigrationIdentifier"].write(value.dataMigrationIdentifier) } } @@ -11946,6 +12502,18 @@ extension DescribeConversionConfigurationInput { } } +extension DescribeDataMigrationsInput { + + static func write(value: DescribeDataMigrationsInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["Filters"].writeList(value.filters, memberWritingClosure: DatabaseMigrationClientTypes.Filter.write(value:to:), memberNodeInfo: "member", isFlattened: false) + try writer["Marker"].write(value.marker) + try writer["MaxRecords"].write(value.maxRecords) + try writer["WithoutSettings"].write(value.withoutSettings) + try writer["WithoutStatistics"].write(value.withoutStatistics) + } +} + extension DescribeDataProvidersInput { static func write(value: DescribeDataProvidersInput?, to writer: SmithyJSON.Writer) throws { @@ -12377,6 +12945,21 @@ extension ModifyConversionConfigurationInput { } } +extension ModifyDataMigrationInput { + + static func write(value: ModifyDataMigrationInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["DataMigrationIdentifier"].write(value.dataMigrationIdentifier) + try writer["DataMigrationName"].write(value.dataMigrationName) + try writer["DataMigrationType"].write(value.dataMigrationType) + try writer["EnableCloudwatchLogs"].write(value.enableCloudwatchLogs) + try writer["NumberOfJobs"].write(value.numberOfJobs) + try writer["SelectionRules"].write(value.selectionRules) + try writer["ServiceAccessRoleArn"].write(value.serviceAccessRoleArn) + try writer["SourceDataSettings"].writeList(value.sourceDataSettings, memberWritingClosure: DatabaseMigrationClientTypes.SourceDataSetting.write(value:to:), memberNodeInfo: "member", isFlattened: false) + } +} + extension ModifyDataProviderInput { static func write(value: ModifyDataProviderInput?, to writer: SmithyJSON.Writer) throws { @@ -12600,6 +13183,15 @@ extension RunFleetAdvisorLsaAnalysisInput { } } +extension StartDataMigrationInput { + + static func write(value: StartDataMigrationInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["DataMigrationIdentifier"].write(value.dataMigrationIdentifier) + try writer["StartType"].write(value.startType) + } +} + extension StartExtensionPackAssociationInput { static func write(value: StartExtensionPackAssociationInput?, to writer: SmithyJSON.Writer) throws { @@ -12715,6 +13307,14 @@ extension StartReplicationTaskAssessmentRunInput { } } +extension StopDataMigrationInput { + + static func write(value: StopDataMigrationInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["DataMigrationIdentifier"].write(value.dataMigrationIdentifier) + } +} + extension StopReplicationInput { static func write(value: StopReplicationInput?, to writer: SmithyJSON.Writer) throws { @@ -12791,6 +13391,18 @@ extension CancelReplicationTaskAssessmentRunOutput { } } +extension CreateDataMigrationOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> CreateDataMigrationOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = CreateDataMigrationOutput() + value.dataMigration = try reader["DataMigration"].readIfPresent(with: DatabaseMigrationClientTypes.DataMigration.read(from:)) + return value + } +} + extension CreateDataProviderOutput { static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> CreateDataProviderOutput { @@ -12939,6 +13551,18 @@ extension DeleteConnectionOutput { } } +extension DeleteDataMigrationOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> DeleteDataMigrationOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = DeleteDataMigrationOutput() + value.dataMigration = try reader["DataMigration"].readIfPresent(with: DatabaseMigrationClientTypes.DataMigration.read(from:)) + return value + } +} + extension DeleteDataProviderOutput { static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> DeleteDataProviderOutput { @@ -13138,6 +13762,19 @@ extension DescribeConversionConfigurationOutput { } } +extension DescribeDataMigrationsOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> DescribeDataMigrationsOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = DescribeDataMigrationsOutput() + value.dataMigrations = try reader["DataMigrations"].readListIfPresent(memberReadingClosure: DatabaseMigrationClientTypes.DataMigration.read(from:), memberNodeInfo: "member", isFlattened: false) + value.marker = try reader["Marker"].readIfPresent() + return value + } +} + extension DescribeDataProvidersOutput { static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> DescribeDataProvidersOutput { @@ -13683,6 +14320,18 @@ extension ModifyConversionConfigurationOutput { } } +extension ModifyDataMigrationOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> ModifyDataMigrationOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = ModifyDataMigrationOutput() + value.dataMigration = try reader["DataMigration"].readIfPresent(with: DatabaseMigrationClientTypes.DataMigration.read(from:)) + return value + } +} + extension ModifyDataProviderOutput { static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> ModifyDataProviderOutput { @@ -13871,6 +14520,18 @@ extension RunFleetAdvisorLsaAnalysisOutput { } } +extension StartDataMigrationOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> StartDataMigrationOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = StartDataMigrationOutput() + value.dataMigration = try reader["DataMigration"].readIfPresent(with: DatabaseMigrationClientTypes.DataMigration.read(from:)) + return value + } +} + extension StartExtensionPackAssociationOutput { static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> StartExtensionPackAssociationOutput { @@ -13998,6 +14659,18 @@ extension StartReplicationTaskAssessmentRunOutput { } } +extension StopDataMigrationOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> StopDataMigrationOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = StopDataMigrationOutput() + value.dataMigration = try reader["DataMigration"].readIfPresent(with: DatabaseMigrationClientTypes.DataMigration.read(from:)) + return value + } +} + extension StopReplicationOutput { static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> StopReplicationOutput { @@ -14054,6 +14727,7 @@ enum AddTagsToResourceOutputError { let baseError = try AWSClientRuntime.AWSJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) if let error = baseError.customError() { return error } switch baseError.code { + case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) } @@ -14106,6 +14780,24 @@ enum CancelReplicationTaskAssessmentRunOutputError { } } +enum CreateDataMigrationOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.AWSJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + switch baseError.code { + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) + case "InvalidOperationFault": return try InvalidOperationFault.makeError(baseError: baseError) + case "ResourceAlreadyExistsFault": return try ResourceAlreadyExistsFault.makeError(baseError: baseError) + case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) + case "ResourceQuotaExceededFault": return try ResourceQuotaExceededFault.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + enum CreateDataProviderOutputError { static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { @@ -14115,6 +14807,7 @@ enum CreateDataProviderOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "ResourceAlreadyExistsFault": return try ResourceAlreadyExistsFault.makeError(baseError: baseError) case "ResourceQuotaExceededFault": return try ResourceQuotaExceededFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) @@ -14192,6 +14885,7 @@ enum CreateInstanceProfileOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) case "KMSKeyNotAccessibleFault": return try KMSKeyNotAccessibleFault.makeError(baseError: baseError) case "ResourceAlreadyExistsFault": return try ResourceAlreadyExistsFault.makeError(baseError: baseError) @@ -14213,6 +14907,7 @@ enum CreateMigrationProjectOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "ResourceAlreadyExistsFault": return try ResourceAlreadyExistsFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) case "ResourceQuotaExceededFault": return try ResourceQuotaExceededFault.makeError(baseError: baseError) @@ -14336,6 +15031,22 @@ enum DeleteConnectionOutputError { } } +enum DeleteDataMigrationOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.AWSJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + switch baseError.code { + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) + case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) + case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + enum DeleteDataProviderOutputError { static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { @@ -14345,6 +15056,7 @@ enum DeleteDataProviderOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) @@ -14390,6 +15102,7 @@ enum DeleteFleetAdvisorCollectorOutputError { let baseError = try AWSClientRuntime.AWSJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) if let error = baseError.customError() { return error } switch baseError.code { + case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) case "CollectorNotFoundFault": return try CollectorNotFoundFault.makeError(baseError: baseError) case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) @@ -14405,6 +15118,7 @@ enum DeleteFleetAdvisorDatabasesOutputError { let baseError = try AWSClientRuntime.AWSJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) if let error = baseError.customError() { return error } switch baseError.code { + case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) case "InvalidOperationFault": return try InvalidOperationFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) @@ -14421,6 +15135,7 @@ enum DeleteInstanceProfileOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) @@ -14437,6 +15152,7 @@ enum DeleteMigrationProjectOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) @@ -14592,6 +15308,22 @@ enum DescribeConversionConfigurationOutputError { } } +enum DescribeDataMigrationsOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.AWSJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + switch baseError.code { + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) + case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) + case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + enum DescribeDataProvidersOutputError { static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { @@ -14601,6 +15333,7 @@ enum DescribeDataProvidersOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) } @@ -14792,6 +15525,7 @@ enum DescribeInstanceProfilesOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) } @@ -14877,6 +15611,7 @@ enum DescribeMigrationProjectsOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) } @@ -15165,6 +15900,7 @@ enum ListTagsForResourceOutputError { let baseError = try AWSClientRuntime.AWSJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) if let error = baseError.customError() { return error } switch baseError.code { + case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) } @@ -15186,6 +15922,22 @@ enum ModifyConversionConfigurationOutputError { } } +enum ModifyDataMigrationOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.AWSJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + switch baseError.code { + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) + case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) + case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + enum ModifyDataProviderOutputError { static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { @@ -15195,6 +15947,7 @@ enum ModifyDataProviderOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) @@ -15251,6 +16004,7 @@ enum ModifyInstanceProfileOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) case "KMSKeyNotAccessibleFault": return try KMSKeyNotAccessibleFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) @@ -15270,6 +16024,7 @@ enum ModifyMigrationProjectOutputError { if let error = baseError.customError() { return error } switch baseError.code { case "AccessDeniedFault": return try AccessDeniedFault.makeError(baseError: baseError) + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) case "S3AccessDeniedFault": return try S3AccessDeniedFault.makeError(baseError: baseError) @@ -15442,6 +16197,7 @@ enum RemoveTagsFromResourceOutputError { let baseError = try AWSClientRuntime.AWSJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) if let error = baseError.customError() { return error } switch baseError.code { + case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) } @@ -15463,6 +16219,24 @@ enum RunFleetAdvisorLsaAnalysisOutputError { } } +enum StartDataMigrationOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.AWSJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + switch baseError.code { + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) + case "InvalidOperationFault": return try InvalidOperationFault.makeError(baseError: baseError) + case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) + case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) + case "ResourceQuotaExceededFault": return try ResourceQuotaExceededFault.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + enum StartExtensionPackAssociationOutputError { static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { @@ -15677,6 +16451,22 @@ enum StartReplicationTaskAssessmentRunOutputError { } } +enum StopDataMigrationOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.AWSJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + switch baseError.code { + case "FailedDependencyFault": return try FailedDependencyFault.makeError(baseError: baseError) + case "InvalidResourceStateFault": return try InvalidResourceStateFault.makeError(baseError: baseError) + case "ResourceNotFoundFault": return try ResourceNotFoundFault.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + enum StopReplicationOutputError { static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { @@ -15741,11 +16531,11 @@ enum UpdateSubscriptionsToEventBridgeOutputError { } } -extension ResourceNotFoundFault { +extension InvalidResourceStateFault { - static func makeError(baseError: AWSClientRuntime.AWSJSONError) throws -> ResourceNotFoundFault { + static func makeError(baseError: AWSClientRuntime.AWSJSONError) throws -> InvalidResourceStateFault { let reader = baseError.errorBodyReader - var value = ResourceNotFoundFault() + var value = InvalidResourceStateFault() value.properties.message = try reader["message"].readIfPresent() value.httpResponse = baseError.httpResponse value.requestID = baseError.requestID @@ -15754,11 +16544,11 @@ extension ResourceNotFoundFault { } } -extension InvalidResourceStateFault { +extension ResourceNotFoundFault { - static func makeError(baseError: AWSClientRuntime.AWSJSONError) throws -> InvalidResourceStateFault { + static func makeError(baseError: AWSClientRuntime.AWSJSONError) throws -> ResourceNotFoundFault { let reader = baseError.errorBodyReader - var value = InvalidResourceStateFault() + var value = ResourceNotFoundFault() value.properties.message = try reader["message"].readIfPresent() value.httpResponse = baseError.httpResponse value.requestID = baseError.requestID @@ -15794,6 +16584,32 @@ extension ResourceAlreadyExistsFault { } } +extension InvalidOperationFault { + + static func makeError(baseError: AWSClientRuntime.AWSJSONError) throws -> InvalidOperationFault { + let reader = baseError.errorBodyReader + var value = InvalidOperationFault() + value.properties.message = try reader["message"].readIfPresent() + value.httpResponse = baseError.httpResponse + value.requestID = baseError.requestID + value.message = baseError.message + return value + } +} + +extension FailedDependencyFault { + + static func makeError(baseError: AWSClientRuntime.AWSJSONError) throws -> FailedDependencyFault { + let reader = baseError.errorBodyReader + var value = FailedDependencyFault() + value.properties.message = try reader["message"].readIfPresent() + value.httpResponse = baseError.httpResponse + value.requestID = baseError.requestID + value.message = baseError.message + return value + } +} + extension ResourceQuotaExceededFault { static func makeError(baseError: AWSClientRuntime.AWSJSONError) throws -> ResourceQuotaExceededFault { @@ -16002,19 +16818,6 @@ extension CollectorNotFoundFault { } } -extension InvalidOperationFault { - - static func makeError(baseError: AWSClientRuntime.AWSJSONError) throws -> InvalidOperationFault { - let reader = baseError.errorBodyReader - var value = InvalidOperationFault() - value.properties.message = try reader["message"].readIfPresent() - value.httpResponse = baseError.httpResponse - value.requestID = baseError.requestID - value.message = baseError.message - return value - } -} - extension InvalidCertificateFault { static func makeError(baseError: AWSClientRuntime.AWSJSONError) throws -> InvalidCertificateFault { @@ -16137,6 +16940,81 @@ extension DatabaseMigrationClientTypes.ReplicationTaskAssessmentRunProgress { } } +extension DatabaseMigrationClientTypes.DataMigration { + + static func read(from reader: SmithyJSON.Reader) throws -> DatabaseMigrationClientTypes.DataMigration { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = DatabaseMigrationClientTypes.DataMigration() + value.dataMigrationName = try reader["DataMigrationName"].readIfPresent() + value.dataMigrationArn = try reader["DataMigrationArn"].readIfPresent() + value.dataMigrationCreateTime = try reader["DataMigrationCreateTime"].readTimestampIfPresent(format: SmithyTimestamps.TimestampFormat.dateTime) + value.dataMigrationStartTime = try reader["DataMigrationStartTime"].readTimestampIfPresent(format: SmithyTimestamps.TimestampFormat.dateTime) + value.dataMigrationEndTime = try reader["DataMigrationEndTime"].readTimestampIfPresent(format: SmithyTimestamps.TimestampFormat.dateTime) + value.serviceAccessRoleArn = try reader["ServiceAccessRoleArn"].readIfPresent() + value.migrationProjectArn = try reader["MigrationProjectArn"].readIfPresent() + value.dataMigrationType = try reader["DataMigrationType"].readIfPresent() + value.dataMigrationSettings = try reader["DataMigrationSettings"].readIfPresent(with: DatabaseMigrationClientTypes.DataMigrationSettings.read(from:)) + value.sourceDataSettings = try reader["SourceDataSettings"].readListIfPresent(memberReadingClosure: DatabaseMigrationClientTypes.SourceDataSetting.read(from:), memberNodeInfo: "member", isFlattened: false) + value.dataMigrationStatistics = try reader["DataMigrationStatistics"].readIfPresent(with: DatabaseMigrationClientTypes.DataMigrationStatistics.read(from:)) + value.dataMigrationStatus = try reader["DataMigrationStatus"].readIfPresent() + value.publicIpAddresses = try reader["PublicIpAddresses"].readListIfPresent(memberReadingClosure: SmithyReadWrite.ReadingClosures.readString(from:), memberNodeInfo: "member", isFlattened: false) + value.lastFailureMessage = try reader["LastFailureMessage"].readIfPresent() + value.stopReason = try reader["StopReason"].readIfPresent() + return value + } +} + +extension DatabaseMigrationClientTypes.DataMigrationStatistics { + + static func read(from reader: SmithyJSON.Reader) throws -> DatabaseMigrationClientTypes.DataMigrationStatistics { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = DatabaseMigrationClientTypes.DataMigrationStatistics() + value.tablesLoaded = try reader["TablesLoaded"].readIfPresent() ?? 0 + value.elapsedTimeMillis = try reader["ElapsedTimeMillis"].readIfPresent() ?? 0 + value.tablesLoading = try reader["TablesLoading"].readIfPresent() ?? 0 + value.fullLoadPercentage = try reader["FullLoadPercentage"].readIfPresent() ?? 0 + value.cdcLatency = try reader["CDCLatency"].readIfPresent() ?? 0 + value.tablesQueued = try reader["TablesQueued"].readIfPresent() ?? 0 + value.tablesErrored = try reader["TablesErrored"].readIfPresent() ?? 0 + value.startTime = try reader["StartTime"].readTimestampIfPresent(format: SmithyTimestamps.TimestampFormat.dateTime) + value.stopTime = try reader["StopTime"].readTimestampIfPresent(format: SmithyTimestamps.TimestampFormat.dateTime) + return value + } +} + +extension DatabaseMigrationClientTypes.SourceDataSetting { + + static func write(value: DatabaseMigrationClientTypes.SourceDataSetting?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["CDCStartPosition"].write(value.cdcStartPosition) + try writer["CDCStartTime"].writeTimestamp(value.cdcStartTime, format: SmithyTimestamps.TimestampFormat.dateTime) + try writer["CDCStopTime"].writeTimestamp(value.cdcStopTime, format: SmithyTimestamps.TimestampFormat.dateTime) + try writer["SlotName"].write(value.slotName) + } + + static func read(from reader: SmithyJSON.Reader) throws -> DatabaseMigrationClientTypes.SourceDataSetting { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = DatabaseMigrationClientTypes.SourceDataSetting() + value.cdcStartPosition = try reader["CDCStartPosition"].readIfPresent() + value.cdcStartTime = try reader["CDCStartTime"].readTimestampIfPresent(format: SmithyTimestamps.TimestampFormat.dateTime) + value.cdcStopTime = try reader["CDCStopTime"].readTimestampIfPresent(format: SmithyTimestamps.TimestampFormat.dateTime) + value.slotName = try reader["SlotName"].readIfPresent() + return value + } +} + +extension DatabaseMigrationClientTypes.DataMigrationSettings { + + static func read(from reader: SmithyJSON.Reader) throws -> DatabaseMigrationClientTypes.DataMigrationSettings { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = DatabaseMigrationClientTypes.DataMigrationSettings() + value.numberOfJobs = try reader["NumberOfJobs"].readIfPresent() + value.cloudwatchLogsEnabled = try reader["CloudwatchLogsEnabled"].readIfPresent() + value.selectionRules = try reader["SelectionRules"].readIfPresent() + return value + } +} + extension DatabaseMigrationClientTypes.DataProvider { static func read(from reader: SmithyJSON.Reader) throws -> DatabaseMigrationClientTypes.DataProvider { diff --git a/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/Paginators.swift b/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/Paginators.swift index 239ce051754..3b93ee1f0f5 100644 --- a/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/Paginators.swift +++ b/Sources/Services/AWSDatabaseMigrationService/Sources/AWSDatabaseMigrationService/Paginators.swift @@ -81,6 +81,39 @@ extension DescribeConnectionsInput: ClientRuntime.PaginateToken { maxRecords: self.maxRecords )} } +extension DatabaseMigrationClient { + /// Paginate over `[DescribeDataMigrationsOutput]` results. + /// + /// When this operation is called, an `AsyncSequence` is created. AsyncSequences are lazy so no service + /// calls are made until the sequence is iterated over. This also means there is no guarantee that the request is valid + /// until then. If there are errors in your request, you will see the failures only after you start iterating. + /// - Parameters: + /// - input: A `[DescribeDataMigrationsInput]` to start pagination + /// - Returns: An `AsyncSequence` that can iterate over `DescribeDataMigrationsOutput` + public func describeDataMigrationsPaginated(input: DescribeDataMigrationsInput) -> ClientRuntime.PaginatorSequence { + return ClientRuntime.PaginatorSequence(input: input, inputKey: \.marker, outputKey: \.marker, paginationFunction: self.describeDataMigrations(input:)) + } +} + +extension DescribeDataMigrationsInput: ClientRuntime.PaginateToken { + public func usingPaginationToken(_ token: Swift.String) -> DescribeDataMigrationsInput { + return DescribeDataMigrationsInput( + filters: self.filters, + marker: token, + maxRecords: self.maxRecords, + withoutSettings: self.withoutSettings, + withoutStatistics: self.withoutStatistics + )} +} + +extension PaginatorSequence where OperationStackInput == DescribeDataMigrationsInput, OperationStackOutput == DescribeDataMigrationsOutput { + /// This paginator transforms the `AsyncSequence` returned by `describeDataMigrationsPaginated` + /// to access the nested member `[DatabaseMigrationClientTypes.DataMigration]` + /// - Returns: `[DatabaseMigrationClientTypes.DataMigration]` + public func dataMigrations() async throws -> [DatabaseMigrationClientTypes.DataMigration] { + return try await self.asyncCompactMap { item in item.dataMigrations } + } +} extension DatabaseMigrationClient { /// Paginate over `[DescribeDataProvidersOutput]` results. /// diff --git a/Sources/Services/AWSEC2/Sources/AWSEC2/EC2Client.swift b/Sources/Services/AWSEC2/Sources/AWSEC2/EC2Client.swift index 4b96377fe34..2e4b2d39cfd 100644 --- a/Sources/Services/AWSEC2/Sources/AWSEC2/EC2Client.swift +++ b/Sources/Services/AWSEC2/Sources/AWSEC2/EC2Client.swift @@ -258,6 +258,70 @@ extension EC2Client { return try await op.execute(input: input) } + /// Performs the `AcceptCapacityReservationBillingOwnership` operation on the `AmazonEC2` service. + /// + /// Accepts a request to assign billing of the available capacity of a shared Capacity Reservation to your account. For more information, see [ Billing assignment for shared Amazon EC2 Capacity Reservations](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/assign-billing.html). + /// + /// - Parameter AcceptCapacityReservationBillingOwnershipInput : [no documentation found] + /// + /// - Returns: `AcceptCapacityReservationBillingOwnershipOutput` : [no documentation found] + public func acceptCapacityReservationBillingOwnership(input: AcceptCapacityReservationBillingOwnershipInput) async throws -> AcceptCapacityReservationBillingOwnershipOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "acceptCapacityReservationBillingOwnership") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "ec2") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(AcceptCapacityReservationBillingOwnershipInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(AcceptCapacityReservationBillingOwnershipOutput.httpOutput(from:), AcceptCapacityReservationBillingOwnershipOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: AcceptCapacityReservationBillingOwnershipInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/x-www-form-urlencoded")) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "EC2") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "AcceptCapacityReservationBillingOwnership") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + /// Performs the `AcceptReservedInstancesExchangeQuote` operation on the `AmazonEC2` service. /// /// Accepts the Convertible Reserved Instance exchange quote described in the [GetReservedInstancesExchangeQuote] call. @@ -1093,7 +1157,7 @@ extension EC2Client { /// Performs the `AssignPrivateNatGatewayAddress` operation on the `AmazonEC2` service. /// - /// Assigns private IPv4 addresses to a private NAT gateway. For more information, see [Work with NAT gateways](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html) in the Amazon VPC User Guide. + /// Assigns private IPv4 addresses to a private NAT gateway. For more information, see [Work with NAT gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-working-with) in the Amazon VPC User Guide. /// /// - Parameter AssignPrivateNatGatewayAddressInput : [no documentation found] /// @@ -1219,6 +1283,70 @@ extension EC2Client { return try await op.execute(input: input) } + /// Performs the `AssociateCapacityReservationBillingOwner` operation on the `AmazonEC2` service. + /// + /// Initiates a request to assign billing of the unused capacity of a shared Capacity Reservation to a consumer account that is consolidated under the same Amazon Web Services organizations payer account. For more information, see [Billing assignment for shared Amazon EC2 Capacity Reservations](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/assign-billing.html). + /// + /// - Parameter AssociateCapacityReservationBillingOwnerInput : [no documentation found] + /// + /// - Returns: `AssociateCapacityReservationBillingOwnerOutput` : [no documentation found] + public func associateCapacityReservationBillingOwner(input: AssociateCapacityReservationBillingOwnerInput) async throws -> AssociateCapacityReservationBillingOwnerOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "associateCapacityReservationBillingOwner") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "ec2") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(AssociateCapacityReservationBillingOwnerInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(AssociateCapacityReservationBillingOwnerOutput.httpOutput(from:), AssociateCapacityReservationBillingOwnerOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: AssociateCapacityReservationBillingOwnerInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/x-www-form-urlencoded")) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "EC2") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "AssociateCapacityReservationBillingOwner") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + /// Performs the `AssociateClientVpnTargetNetwork` operation on the `AmazonEC2` service. /// /// Associates a target network with a Client VPN endpoint. A target network is a subnet in a VPC. You can associate multiple subnets from the same VPC with a Client VPN endpoint. You can associate only one subnet in each Availability Zone. We recommend that you associate at least two subnets to provide Availability Zone redundancy. If you specified a VPC when you created the Client VPN endpoint or if you have previous subnet associations, the specified subnet must be in the same VPC. To specify a subnet that's in a different VPC, you must first modify the Client VPN endpoint ([ModifyClientVpnEndpoint]) and change the VPC that's associated with it. @@ -1671,7 +1799,7 @@ extension EC2Client { /// Performs the `AssociateNatGatewayAddress` operation on the `AmazonEC2` service. /// - /// Associates Elastic IP addresses (EIPs) and private IPv4 addresses with a public NAT gateway. For more information, see [Work with NAT gateways](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html) in the Amazon VPC User Guide. By default, you can associate up to 2 Elastic IP addresses per public NAT gateway. You can increase the limit by requesting a quota adjustment. For more information, see [Elastic IP address quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-eips) in the Amazon VPC User Guide. When you associate an EIP or secondary EIPs with a public NAT gateway, the network border group of the EIPs must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. If it's not the same, the EIP will fail to associate. You can see the network border group for the subnet's AZ by viewing the details of the subnet. Similarly, you can view the network border group of an EIP by viewing the details of the EIP address. For more information about network border groups and EIPs, see [Allocate an Elastic IP address](https://docs.aws.amazon.com/vpc/latest/userguide/WorkWithEIPs.html) in the Amazon VPC User Guide. + /// Associates Elastic IP addresses (EIPs) and private IPv4 addresses with a public NAT gateway. For more information, see [Work with NAT gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-working-with) in the Amazon VPC User Guide. By default, you can associate up to 2 Elastic IP addresses per public NAT gateway. You can increase the limit by requesting a quota adjustment. For more information, see [Elastic IP address quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-eips) in the Amazon VPC User Guide. When you associate an EIP or secondary EIPs with a public NAT gateway, the network border group of the EIPs must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. If it's not the same, the EIP will fail to associate. You can see the network border group for the subnet's AZ by viewing the details of the subnet. Similarly, you can view the network border group of an EIP by viewing the details of the EIP address. For more information about network border groups and EIPs, see [Allocate an Elastic IP address](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#allocate-eip) in the Amazon VPC User Guide. /// /// - Parameter AssociateNatGatewayAddressInput : [no documentation found] /// @@ -4322,7 +4450,7 @@ extension EC2Client { /// Performs the `CreateDefaultSubnet` operation on the `AmazonEC2` service. /// - /// Creates a default subnet with a size /20 IPv4 CIDR block in the specified Availability Zone in your default VPC. You can have only one default subnet per Availability Zone. For more information, see [Create a default subnet](https://docs.aws.amazon.com/vpc/latest/userguide/work-with-default-vpc.html#create-default-subnet) in the Amazon VPC User Guide. + /// Creates a default subnet with a size /20 IPv4 CIDR block in the specified Availability Zone in your default VPC. You can have only one default subnet per Availability Zone. For more information, see [Create a default subnet](https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html#create-default-subnet) in the Amazon VPC User Guide. /// /// - Parameter CreateDefaultSubnetInput : [no documentation found] /// @@ -4654,7 +4782,7 @@ extension EC2Client { /// Performs the `CreateFlowLogs` operation on the `AmazonEC2` service. /// - /// Creates one or more flow logs to capture information about IP traffic for a specific network interface, subnet, or VPC. Flow log data for a monitored network interface is recorded as flow log records, which are log events consisting of fields that describe the traffic flow. For more information, see [Flow log records](https://docs.aws.amazon.com/vpc/latest/userguide/flow-log-records.html) in the Amazon VPC User Guide. When publishing to CloudWatch Logs, flow log records are published to a log group, and each network interface has a unique log stream in the log group. When publishing to Amazon S3, flow log records for all of the monitored network interfaces are published to a single log file object that is stored in the specified bucket. For more information, see [VPC Flow Logs](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html) in the Amazon VPC User Guide. + /// Creates one or more flow logs to capture information about IP traffic for a specific network interface, subnet, or VPC. Flow log data for a monitored network interface is recorded as flow log records, which are log events consisting of fields that describe the traffic flow. For more information, see [Flow log records](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html#flow-log-records) in the Amazon VPC User Guide. When publishing to CloudWatch Logs, flow log records are published to a log group, and each network interface has a unique log stream in the log group. When publishing to Amazon S3, flow log records for all of the monitored network interfaces are published to a single log file object that is stored in the specified bucket. For more information, see [VPC Flow Logs](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html) in the Amazon VPC User Guide. /// /// - Parameter CreateFlowLogsInput : [no documentation found] /// @@ -5952,7 +6080,7 @@ extension EC2Client { /// Performs the `CreateNatGateway` operation on the `AmazonEC2` service. /// - /// Creates a NAT gateway in the specified subnet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. You can create either a public NAT gateway or a private NAT gateway. With a public NAT gateway, internet-bound traffic from a private subnet can be routed to the NAT gateway, so that instances in a private subnet can connect to the internet. With a private NAT gateway, private communication is routed across VPCs and on-premises networks through a transit gateway or virtual private gateway. Common use cases include running large workloads behind a small pool of allowlisted IPv4 addresses, preserving private IPv4 addresses, and communicating between overlapping networks. For more information, see [NAT gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in the Amazon VPC User Guide. When you create a public NAT gateway and assign it an EIP or secondary EIPs, the network border group of the EIPs must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. If it's not the same, the NAT gateway will fail to launch. You can see the network border group for the subnet's AZ by viewing the details of the subnet. Similarly, you can view the network border group of an EIP by viewing the details of the EIP address. For more information about network border groups and EIPs, see [Allocate an Elastic IP address](https://docs.aws.amazon.com/vpc/latest/userguide/WorkWithEIPs.html) in the Amazon VPC User Guide. + /// Creates a NAT gateway in the specified subnet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. You can create either a public NAT gateway or a private NAT gateway. With a public NAT gateway, internet-bound traffic from a private subnet can be routed to the NAT gateway, so that instances in a private subnet can connect to the internet. With a private NAT gateway, private communication is routed across VPCs and on-premises networks through a transit gateway or virtual private gateway. Common use cases include running large workloads behind a small pool of allowlisted IPv4 addresses, preserving private IPv4 addresses, and communicating between overlapping networks. For more information, see [NAT gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in the Amazon VPC User Guide. When you create a public NAT gateway and assign it an EIP or secondary EIPs, the network border group of the EIPs must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. If it's not the same, the NAT gateway will fail to launch. You can see the network border group for the subnet's AZ by viewing the details of the subnet. Similarly, you can view the network border group of an EIP by viewing the details of the EIP address. For more information about network border groups and EIPs, see [Allocate an Elastic IP address](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#allocate-eip) in the Amazon VPC User Guide. /// /// - Parameter CreateNatGatewayInput : [no documentation found] /// @@ -7246,7 +7374,7 @@ extension EC2Client { /// Performs the `CreateSubnetCidrReservation` operation on the `AmazonEC2` service. /// - /// Creates a subnet CIDR reservation. For more information, see [Subnet CIDR reservations](https://docs.aws.amazon.com/vpc/latest/userguide/subnet-cidr-reservation.html) in the Amazon VPC User Guide and [Manage prefixes for your network interfaces](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/work-with-prefixes.html) in the Amazon EC2 User Guide. + /// Creates a subnet CIDR reservation. For more information, see [Subnet CIDR reservations](https://docs.aws.amazon.com/vpc/latest/userguide/subnet-cidr-reservation.html) in the Amazon VPC User Guide and [Assign prefixes to network interfaces](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html) in the Amazon EC2 User Guide. /// /// - Parameter CreateSubnetCidrReservationInput : [no documentation found] /// @@ -13485,7 +13613,7 @@ extension EC2Client { /// Performs the `DeleteVpc` operation on the `AmazonEC2` service. /// - /// Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on. When you delete the VPC, it deletes the default security group, network ACL, and route table for the VPC. If you created a flow log for the VPC that you are deleting, note that flow logs for deleted VPCs are eventually automatically removed. + /// Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on. When you delete the VPC, it deletes the VPC's default security group, network ACL, and route table. /// /// - Parameter DeleteVpcInput : [no documentation found] /// @@ -15162,6 +15290,70 @@ extension EC2Client { return try await op.execute(input: input) } + /// Performs the `DescribeCapacityReservationBillingRequests` operation on the `AmazonEC2` service. + /// + /// Describes a request to assign the billing of the unused capacity of a Capacity Reservation. For more information, see [ Billing assignment for shared Amazon EC2 Capacity Reservations](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/transfer-billing.html). + /// + /// - Parameter DescribeCapacityReservationBillingRequestsInput : [no documentation found] + /// + /// - Returns: `DescribeCapacityReservationBillingRequestsOutput` : [no documentation found] + public func describeCapacityReservationBillingRequests(input: DescribeCapacityReservationBillingRequestsInput) async throws -> DescribeCapacityReservationBillingRequestsOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "describeCapacityReservationBillingRequests") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "ec2") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(DescribeCapacityReservationBillingRequestsInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(DescribeCapacityReservationBillingRequestsOutput.httpOutput(from:), DescribeCapacityReservationBillingRequestsOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: DescribeCapacityReservationBillingRequestsInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/x-www-form-urlencoded")) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "EC2") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "DescribeCapacityReservationBillingRequests") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + /// Performs the `DescribeCapacityReservationFleets` operation on the `AmazonEC2` service. /// /// Describes one or more Capacity Reservation Fleets. @@ -16060,7 +16252,7 @@ extension EC2Client { /// Performs the `DescribeElasticGpus` operation on the `AmazonEC2` service. /// - /// Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4, G5, or G6 instances. Describes the Elastic Graphics accelerator associated with your instances. + /// Amazon Elastic Graphics reached end of life on January 8, 2024. Describes the Elastic Graphics accelerator associated with your instances. /// /// - Parameter DescribeElasticGpusInput : [no documentation found] /// @@ -25764,6 +25956,70 @@ extension EC2Client { return try await op.execute(input: input) } + /// Performs the `DisassociateCapacityReservationBillingOwner` operation on the `AmazonEC2` service. + /// + /// Cancels a pending request to assign billing of the unused capacity of a Capacity Reservation to a consumer account, or revokes a request that has already been accepted. For more information, see [Billing assignment for shared Amazon EC2 Capacity Reservations](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/assign-billing.html). + /// + /// - Parameter DisassociateCapacityReservationBillingOwnerInput : [no documentation found] + /// + /// - Returns: `DisassociateCapacityReservationBillingOwnerOutput` : [no documentation found] + public func disassociateCapacityReservationBillingOwner(input: DisassociateCapacityReservationBillingOwnerInput) async throws -> DisassociateCapacityReservationBillingOwnerOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "disassociateCapacityReservationBillingOwner") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "ec2") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(DisassociateCapacityReservationBillingOwnerInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(DisassociateCapacityReservationBillingOwnerOutput.httpOutput(from:), DisassociateCapacityReservationBillingOwnerOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: DisassociateCapacityReservationBillingOwnerInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/x-www-form-urlencoded")) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "EC2") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "DisassociateCapacityReservationBillingOwner") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + /// Performs the `DisassociateClientVpnTargetNetwork` operation on the `AmazonEC2` service. /// /// Disassociates a target network from the specified Client VPN endpoint. When you disassociate the last target network from a Client VPN, the following happens: @@ -26158,7 +26414,7 @@ extension EC2Client { /// Performs the `DisassociateNatGatewayAddress` operation on the `AmazonEC2` service. /// - /// Disassociates secondary Elastic IP addresses (EIPs) from a public NAT gateway. You cannot disassociate your primary EIP. For more information, see [Edit secondary IP address associations](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html#nat-gateway-edit-secondary) in the Amazon VPC User Guide. While disassociating is in progress, you cannot associate/disassociate additional EIPs while the connections are being drained. You are, however, allowed to delete the NAT gateway. An EIP is released only at the end of MaxDrainDurationSeconds. It stays associated and supports the existing connections but does not support any new connections (new connections are distributed across the remaining associated EIPs). As the existing connections drain out, the EIPs (and the corresponding private IP addresses mapped to them) are released. + /// Disassociates secondary Elastic IP addresses (EIPs) from a public NAT gateway. You cannot disassociate your primary EIP. For more information, see [Edit secondary IP address associations](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-edit-secondary) in the Amazon VPC User Guide. While disassociating is in progress, you cannot associate/disassociate additional EIPs while the connections are being drained. You are, however, allowed to delete the NAT gateway. An EIP is released only at the end of MaxDrainDurationSeconds. It stays associated and supports the existing connections but does not support any new connections (new connections are distributed across the remaining associated EIPs). As the existing connections drain out, the EIPs (and the corresponding private IP addresses mapped to them) are released. /// /// - Parameter DisassociateNatGatewayAddressInput : [no documentation found] /// @@ -32769,7 +33025,7 @@ extension EC2Client { /// Performs the `ModifyInstanceCpuOptions` operation on the `AmazonEC2` service. /// - /// By default, all vCPUs for the instance type are active when you launch an instance. When you configure the number of active vCPUs for the instance, it can help you save on licensing costs and optimize performance. The base cost of the instance remains unchanged. The number of active vCPUs equals the number of threads per CPU core multiplied by the number of cores. Some instance type options do not support this capability. For more information, see [Supported CPU options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cpu-options-supported-instances-values.html) in the Amazon EC2 User Guide. + /// By default, all vCPUs for the instance type are active when you launch an instance. When you configure the number of active vCPUs for the instance, it can help you save on licensing costs and optimize performance. The base cost of the instance remains unchanged. The number of active vCPUs equals the number of threads per CPU core multiplied by the number of cores. The instance must be in a Stopped state before you make changes. Some instance type options do not support this capability. For more information, see [Supported CPU options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cpu-options-supported-instances-values.html) in the Amazon EC2 User Guide. /// /// - Parameter ModifyInstanceCpuOptionsInput : [no documentation found] /// @@ -37174,6 +37430,70 @@ extension EC2Client { return try await op.execute(input: input) } + /// Performs the `RejectCapacityReservationBillingOwnership` operation on the `AmazonEC2` service. + /// + /// Rejects a request to assign billing of the available capacity of a shared Capacity Reservation to your account. For more information, see [ Billing assignment for shared Amazon EC2 Capacity Reservations](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/assign-billing.html). + /// + /// - Parameter RejectCapacityReservationBillingOwnershipInput : [no documentation found] + /// + /// - Returns: `RejectCapacityReservationBillingOwnershipOutput` : [no documentation found] + public func rejectCapacityReservationBillingOwnership(input: RejectCapacityReservationBillingOwnershipInput) async throws -> RejectCapacityReservationBillingOwnershipOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "rejectCapacityReservationBillingOwnership") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "ec2") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(RejectCapacityReservationBillingOwnershipInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(RejectCapacityReservationBillingOwnershipOutput.httpOutput(from:), RejectCapacityReservationBillingOwnershipOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: RejectCapacityReservationBillingOwnershipInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/x-www-form-urlencoded")) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "EC2") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "RejectCapacityReservationBillingOwnership") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + /// Performs the `RejectTransitGatewayMulticastDomainAssociations` operation on the `AmazonEC2` service. /// /// Rejects a request to associate cross-account subnets with a transit gateway multicast domain. @@ -40290,7 +40610,7 @@ extension EC2Client { /// Performs the `UnassignPrivateNatGatewayAddress` operation on the `AmazonEC2` service. /// - /// Unassigns secondary private IPv4 addresses from a private NAT gateway. You cannot unassign your primary private IP. For more information, see [Edit secondary IP address associations](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html#nat-gateway-edit-secondary) in the Amazon VPC User Guide. While unassigning is in progress, you cannot assign/unassign additional IP addresses while the connections are being drained. You are, however, allowed to delete the NAT gateway. A private IP address will only be released at the end of MaxDrainDurationSeconds. The private IP addresses stay associated and support the existing connections, but do not support any new connections (new connections are distributed across the remaining assigned private IP address). After the existing connections drain out, the private IP addresses are released. + /// Unassigns secondary private IPv4 addresses from a private NAT gateway. You cannot unassign your primary private IP. For more information, see [Edit secondary IP address associations](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-edit-secondary) in the Amazon VPC User Guide. While unassigning is in progress, you cannot assign/unassign additional IP addresses while the connections are being drained. You are, however, allowed to delete the NAT gateway. A private IP address will only be released at the end of MaxDrainDurationSeconds. The private IP addresses stay associated and support the existing connections, but do not support any new connections (new connections are distributed across the remaining assigned private IP address). After the existing connections drain out, the private IP addresses are released. /// /// - Parameter UnassignPrivateNatGatewayAddressInput : [no documentation found] /// diff --git a/Sources/Services/AWSEC2/Sources/AWSEC2/Models.swift b/Sources/Services/AWSEC2/Sources/AWSEC2/Models.swift index 6e44506e02b..294381de4d6 100644 --- a/Sources/Services/AWSEC2/Sources/AWSEC2/Models.swift +++ b/Sources/Services/AWSEC2/Sources/AWSEC2/Models.swift @@ -933,6 +933,35 @@ public struct AcceptAddressTransferOutput: Swift.Sendable { } } +public struct AcceptCapacityReservationBillingOwnershipInput: Swift.Sendable { + /// The ID of the Capacity Reservation for which to accept the request. + /// This member is required. + public var capacityReservationId: Swift.String? + /// Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. + public var dryRun: Swift.Bool? + + public init( + capacityReservationId: Swift.String? = nil, + dryRun: Swift.Bool? = nil + ) + { + self.capacityReservationId = capacityReservationId + self.dryRun = dryRun + } +} + +public struct AcceptCapacityReservationBillingOwnershipOutput: Swift.Sendable { + /// Returns true if the request succeeds; otherwise, it returns an error. + public var `return`: Swift.Bool? + + public init( + `return`: Swift.Bool? = nil + ) + { + self.`return` = `return` + } +} + extension EC2ClientTypes { /// Details about the target configuration. @@ -4697,6 +4726,40 @@ public struct AssociateAddressOutput: Swift.Sendable { } } +public struct AssociateCapacityReservationBillingOwnerInput: Swift.Sendable { + /// The ID of the Capacity Reservation. + /// This member is required. + public var capacityReservationId: Swift.String? + /// Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. + public var dryRun: Swift.Bool? + /// The ID of the consumer account to which assign billing. + /// This member is required. + public var unusedReservationBillingOwnerId: Swift.String? + + public init( + capacityReservationId: Swift.String? = nil, + dryRun: Swift.Bool? = nil, + unusedReservationBillingOwnerId: Swift.String? = nil + ) + { + self.capacityReservationId = capacityReservationId + self.dryRun = dryRun + self.unusedReservationBillingOwnerId = unusedReservationBillingOwnerId + } +} + +public struct AssociateCapacityReservationBillingOwnerOutput: Swift.Sendable { + /// Returns true if the request succeeds; otherwise, it returns an error. + public var `return`: Swift.Bool? + + public init( + `return`: Swift.Bool? = nil + ) + { + self.`return` = `return` + } +} + public struct AssociateClientVpnTargetNetworkInput: Swift.Sendable { /// Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see [Ensuring idempotency](https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html). public var clientToken: Swift.String? @@ -9171,6 +9234,8 @@ extension EC2ClientTypes { public var tenancy: EC2ClientTypes.CapacityReservationTenancy? /// The total number of instances for which the Capacity Reservation reserves capacity. public var totalInstanceCount: Swift.Int? + /// The ID of the Amazon Web Services account to which billing of the unused capacity of the Capacity Reservation is assigned. + public var unusedReservationBillingOwnerId: Swift.String? public init( availabilityZone: Swift.String? = nil, @@ -9196,7 +9261,8 @@ extension EC2ClientTypes { state: EC2ClientTypes.CapacityReservationState? = nil, tags: [EC2ClientTypes.Tag]? = nil, tenancy: EC2ClientTypes.CapacityReservationTenancy? = nil, - totalInstanceCount: Swift.Int? = nil + totalInstanceCount: Swift.Int? = nil, + unusedReservationBillingOwnerId: Swift.String? = nil ) { self.availabilityZone = availabilityZone @@ -9223,6 +9289,7 @@ extension EC2ClientTypes { self.tags = tags self.tenancy = tenancy self.totalInstanceCount = totalInstanceCount + self.unusedReservationBillingOwnerId = unusedReservationBillingOwnerId } } } @@ -13924,8 +13991,6 @@ extension EC2ClientTypes { /// /// * To include instance types with FPGA hardware, specify fpga. /// - /// * To include instance types with inference hardware, specify inference. - /// /// /// Default: Any accelerator type public var acceleratorTypes: [EC2ClientTypes.AcceleratorType]? @@ -14932,8 +14997,6 @@ extension EC2ClientTypes { /// /// * For instance types with FPGA accelerators, specify fpga. /// - /// * For instance types with inference accelerators, specify inference. - /// /// /// Default: Any accelerator type public var acceleratorTypes: [EC2ClientTypes.AcceleratorType]? @@ -15492,7 +15555,7 @@ public struct CreateFlowLogsInput: Swift.Sendable { public var logDestination: Swift.String? /// The type of destination for the flow log data. Default: cloud-watch-logs public var logDestinationType: EC2ClientTypes.LogDestinationType? - /// The fields to include in the flow log record. List the fields in the order in which they should appear. If you omit this parameter, the flow log is created using the default format. If you specify this parameter, you must include at least one field. For more information about the available fields, see [Flow log records](https://docs.aws.amazon.com/vpc/latest/userguide/flow-log-records.html) in the Amazon VPC User Guide or [Transit Gateway Flow Log records](https://docs.aws.amazon.com/vpc/latest/tgw/tgw-flow-logs.html#flow-log-records) in the Amazon Web Services Transit Gateway Guide. Specify the fields using the ${field-id} format, separated by spaces. + /// The fields to include in the flow log record. List the fields in the order in which they should appear. If you omit this parameter, the flow log is created using the default format. If you specify this parameter, you must include at least one field. For more information about the available fields, see [Flow log records](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html#flow-log-records) in the Amazon VPC User Guide or [Transit Gateway Flow Log records](https://docs.aws.amazon.com/vpc/latest/tgw/tgw-flow-logs.html#flow-log-records) in the Amazon Web Services Transit Gateway Guide. Specify the fields using the ${field-id} format, separated by spaces. public var logFormat: Swift.String? /// The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. This parameter is valid only if the destination type is cloud-watch-logs. public var logGroupName: Swift.String? @@ -18010,7 +18073,7 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4, G5, or G6 instances. A specification for an Elastic Graphics accelerator. + /// Amazon Elastic Graphics reached end of life on January 8, 2024. A specification for an Elastic Graphics accelerator. public struct ElasticGpuSpecification: Swift.Sendable { /// The type of Elastic Graphics accelerator. /// This member is required. @@ -18027,7 +18090,7 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Describes an elastic inference accelerator. + /// Amazon Elastic Inference is no longer available. Describes an elastic inference accelerator. public struct LaunchTemplateElasticInferenceAccelerator: Swift.Sendable { /// The number of elastic inference accelerators to attach to the instance. Default: 1 public var count: Swift.Int? @@ -18846,9 +18909,9 @@ extension EC2ClientTypes { public var disableApiTermination: Swift.Bool? /// Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance. public var ebsOptimized: Swift.Bool? - /// Deprecated. Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances. + /// Deprecated. Amazon Elastic Graphics reached end of life on January 8, 2024. public var elasticGpuSpecifications: [EC2ClientTypes.ElasticGpuSpecification]? - /// An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads. You cannot specify accelerators from different generations in the same request. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. + /// Deprecated. Amazon Elastic Inference is no longer available. public var elasticInferenceAccelerators: [EC2ClientTypes.LaunchTemplateElasticInferenceAccelerator]? /// Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see [What is Amazon Web Services Nitro Enclaves?](https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html) in the Amazon Web Services Nitro Enclaves User Guide. You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance. public var enclaveOptions: EC2ClientTypes.LaunchTemplateEnclaveOptionsRequest? @@ -19328,9 +19391,9 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Deprecated. Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances. + /// Amazon Elastic Graphics reached end of life on January 8, 2024. Describes an elastic GPU. public struct ElasticGpuSpecificationResponse: Swift.Sendable { - /// Deprecated. Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances. + /// The elastic GPU type. public var type: Swift.String? public init( @@ -19344,7 +19407,7 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Describes an elastic inference accelerator. + /// Amazon Elastic Inference is no longer available. Describes an elastic inference accelerator. public struct LaunchTemplateElasticInferenceAcceleratorResponse: Swift.Sendable { /// The number of elastic inference accelerators to attach to the instance. Default: 1 public var count: Swift.Int? @@ -19905,9 +19968,9 @@ extension EC2ClientTypes { public var disableApiTermination: Swift.Bool? /// Indicates whether the instance is optimized for Amazon EBS I/O. public var ebsOptimized: Swift.Bool? - /// Deprecated. Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances. + /// Deprecated. Amazon Elastic Graphics reached end of life on January 8, 2024. public var elasticGpuSpecifications: [EC2ClientTypes.ElasticGpuSpecificationResponse]? - /// An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads. You cannot specify accelerators from different generations in the same request. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. + /// Deprecated. Amazon Elastic Inference is no longer available. public var elasticInferenceAccelerators: [EC2ClientTypes.LaunchTemplateElasticInferenceAcceleratorResponse]? /// Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. public var enclaveOptions: EC2ClientTypes.LaunchTemplateEnclaveOptions? @@ -20789,11 +20852,11 @@ public struct CreateNatGatewayInput: Swift.Sendable { public var dryRun: Swift.Bool? /// The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned. public var privateIpAddress: Swift.String? - /// Secondary EIP allocation IDs. For more information, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html) in the Amazon VPC User Guide. + /// Secondary EIP allocation IDs. For more information, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the Amazon VPC User Guide. public var secondaryAllocationIds: [Swift.String]? - /// [Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html) in the Amazon VPC User Guide. + /// [Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the Amazon VPC User Guide. public var secondaryPrivateIpAddressCount: Swift.Int? - /// Secondary private IPv4 addresses. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-working-with.html) in the Amazon VPC User Guide. + /// Secondary private IPv4 addresses. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the Amazon VPC User Guide. public var secondaryPrivateIpAddresses: [Swift.String]? /// The ID of the subnet in which to create the NAT gateway. /// This member is required. @@ -26330,7 +26393,7 @@ extension EC2ClientTypes { public var dnsSupport: EC2ClientTypes.DnsSupportValue? /// Enable or disable IPv6 support. The default is disable. public var ipv6Support: EC2ClientTypes.Ipv6SupportValue? - /// Enables you to reference a security group across VPCs attached to a transit gateway to simplify security group management. This option is enabled by default. However, security group referencing is disabled by default at the transit gateway level. For more information about security group referencing, see [Security group referencing ](https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security) in the Amazon Web Services Transit Gateways Guide. + /// Enables you to reference a security group across VPCs attached to a transit gateway to simplify security group management. This option is set to enable by default. However, at the transit gateway level the default is set to disable. For more information about security group referencing, see [Security group referencing ](https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html#vpc-attachment-security) in the Amazon Web Services Transit Gateways Guide. public var securityGroupReferencingSupport: EC2ClientTypes.SecurityGroupReferencingSupportValue? public init( @@ -33265,6 +33328,199 @@ public struct DescribeCapacityBlockOfferingsOutput: Swift.Sendable { } } +extension EC2ClientTypes { + + public enum CallerRole: Swift.Sendable, Swift.Equatable, Swift.RawRepresentable, Swift.CaseIterable, Swift.Hashable { + case odcrOwner + case unusedReservationBillingOwner + case sdkUnknown(Swift.String) + + public static var allCases: [CallerRole] { + return [ + .odcrOwner, + .unusedReservationBillingOwner + ] + } + + public init?(rawValue: Swift.String) { + let value = Self.allCases.first(where: { $0.rawValue == rawValue }) + self = value ?? Self.sdkUnknown(rawValue) + } + + public var rawValue: Swift.String { + switch self { + case .odcrOwner: return "odcr-owner" + case .unusedReservationBillingOwner: return "unused-reservation-billing-owner" + case let .sdkUnknown(s): return s + } + } + } +} + +public struct DescribeCapacityReservationBillingRequestsInput: Swift.Sendable { + /// The ID of the Capacity Reservation. + public var capacityReservationIds: [Swift.String]? + /// Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. + public var dryRun: Swift.Bool? + /// One or more filters. + /// + /// * status - The state of the request (pending | accepted | rejected | cancelled | revoked | expired). + /// + /// * requested-by - The account ID of the Capacity Reservation owner that initiated the request. Not supported if you specify requested-by for Role. + /// + /// * unused-reservation-billing-owner - The ID of the consumer account to which the request was sent. Not supported if you specify unused-reservation-billing-owner for Role. + public var filters: [EC2ClientTypes.Filter]? + /// The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see [Pagination](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination). + public var maxResults: Swift.Int? + /// The token to use to retrieve the next page of results. + public var nextToken: Swift.String? + /// Specify one of the following: + /// + /// * odcr-owner - If you are the Capacity Reservation owner, specify this value to view requests that you have initiated. Not supported with the requested-by filter. + /// + /// * unused-reservation-billing-owner - If you are the consumer account, specify this value to view requests that have been sent to you. Not supported with the unused-reservation-billing-owner filter. + /// This member is required. + public var role: EC2ClientTypes.CallerRole? + + public init( + capacityReservationIds: [Swift.String]? = nil, + dryRun: Swift.Bool? = nil, + filters: [EC2ClientTypes.Filter]? = nil, + maxResults: Swift.Int? = nil, + nextToken: Swift.String? = nil, + role: EC2ClientTypes.CallerRole? = nil + ) + { + self.capacityReservationIds = capacityReservationIds + self.dryRun = dryRun + self.filters = filters + self.maxResults = maxResults + self.nextToken = nextToken + self.role = role + } +} + +extension EC2ClientTypes { + + /// Information about a Capacity Reservation. + public struct CapacityReservationInfo: Swift.Sendable { + /// The Availability Zone for the Capacity Reservation. + public var availabilityZone: Swift.String? + /// The instance type for the Capacity Reservation. + public var instanceType: Swift.String? + /// The tenancy of the Capacity Reservation. + public var tenancy: EC2ClientTypes.CapacityReservationTenancy? + + public init( + availabilityZone: Swift.String? = nil, + instanceType: Swift.String? = nil, + tenancy: EC2ClientTypes.CapacityReservationTenancy? = nil + ) + { + self.availabilityZone = availabilityZone + self.instanceType = instanceType + self.tenancy = tenancy + } + } +} + +extension EC2ClientTypes { + + public enum CapacityReservationBillingRequestStatus: Swift.Sendable, Swift.Equatable, Swift.RawRepresentable, Swift.CaseIterable, Swift.Hashable { + case accepted + case cancelled + case expired + case pending + case rejected + case revoked + case sdkUnknown(Swift.String) + + public static var allCases: [CapacityReservationBillingRequestStatus] { + return [ + .accepted, + .cancelled, + .expired, + .pending, + .rejected, + .revoked + ] + } + + public init?(rawValue: Swift.String) { + let value = Self.allCases.first(where: { $0.rawValue == rawValue }) + self = value ?? Self.sdkUnknown(rawValue) + } + + public var rawValue: Swift.String { + switch self { + case .accepted: return "accepted" + case .cancelled: return "cancelled" + case .expired: return "expired" + case .pending: return "pending" + case .rejected: return "rejected" + case .revoked: return "revoked" + case let .sdkUnknown(s): return s + } + } + } +} + +extension EC2ClientTypes { + + /// Information about a request to assign billing of the unused capacity of a Capacity Reservation. + public struct CapacityReservationBillingRequest: Swift.Sendable { + /// The ID of the Capacity Reservation. + public var capacityReservationId: Swift.String? + /// Information about the Capacity Reservation. + public var capacityReservationInfo: EC2ClientTypes.CapacityReservationInfo? + /// The date and time, in UTC time format, at which the request was initiated. + public var lastUpdateTime: Foundation.Date? + /// The ID of the Amazon Web Services account that initiated the request. + public var requestedBy: Swift.String? + /// The status of the request. For more information, see [ View billing assignment requests for a shared Amazon EC2 Capacity Reservation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/view-billing-transfers.html). + public var status: EC2ClientTypes.CapacityReservationBillingRequestStatus? + /// Information about the status. + public var statusMessage: Swift.String? + /// The ID of the Amazon Web Services account to which the request was sent. + public var unusedReservationBillingOwnerId: Swift.String? + + public init( + capacityReservationId: Swift.String? = nil, + capacityReservationInfo: EC2ClientTypes.CapacityReservationInfo? = nil, + lastUpdateTime: Foundation.Date? = nil, + requestedBy: Swift.String? = nil, + status: EC2ClientTypes.CapacityReservationBillingRequestStatus? = nil, + statusMessage: Swift.String? = nil, + unusedReservationBillingOwnerId: Swift.String? = nil + ) + { + self.capacityReservationId = capacityReservationId + self.capacityReservationInfo = capacityReservationInfo + self.lastUpdateTime = lastUpdateTime + self.requestedBy = requestedBy + self.status = status + self.statusMessage = statusMessage + self.unusedReservationBillingOwnerId = unusedReservationBillingOwnerId + } + } +} + +public struct DescribeCapacityReservationBillingRequestsOutput: Swift.Sendable { + /// Information about the request. + public var capacityReservationBillingRequests: [EC2ClientTypes.CapacityReservationBillingRequest]? + /// The token to use to retrieve the next page of results. This value is null when there are no more results to return. + public var nextToken: Swift.String? + + public init( + capacityReservationBillingRequests: [EC2ClientTypes.CapacityReservationBillingRequest]? = nil, + nextToken: Swift.String? = nil + ) + { + self.capacityReservationBillingRequests = capacityReservationBillingRequests + self.nextToken = nextToken + } +} + public struct DescribeCapacityReservationFleetsInput: Swift.Sendable { /// The IDs of the Capacity Reservation Fleets to describe. public var capacityReservationFleetIds: [Swift.String]? @@ -35027,7 +35283,7 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4, G5, or G6 instances. Describes the status of an Elastic Graphics accelerator. + /// Amazon Elastic Graphics reached end of life on January 8, 2024. Describes the status of an Elastic Graphics accelerator. public struct ElasticGpuHealth: Swift.Sendable { /// The health status. public var status: EC2ClientTypes.ElasticGpuStatus? @@ -35069,7 +35325,7 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4, G5, or G6 instances. Describes an Elastic Graphics accelerator. + /// Amazon Elastic Graphics reached end of life on January 8, 2024. Describes an Elastic Graphics accelerator. public struct ElasticGpus: Swift.Sendable { /// The Availability Zone in the which the Elastic Graphics accelerator resides. public var availabilityZone: Swift.String? @@ -39112,8 +39368,6 @@ public struct DescribeInstancesInput: Swift.Sendable { /// /// * iam-instance-profile.id - The instance profile associated with the instance. Specified as an ID. /// - /// * iam-instance-profile.name - The instance profile associated with the instance. Specified as an name. - /// /// * image-id - The ID of the image used to launch the instance. /// /// * instance-id - The ID of the instance. @@ -39428,7 +39682,7 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4, G5, or G6 instances. Describes the association between an instance and an Elastic Graphics accelerator. + /// Amazon Elastic Graphics reached end of life on January 8, 2024. Describes the association between an instance and an Elastic Graphics accelerator. public struct ElasticGpuAssociation: Swift.Sendable { /// The ID of the association. public var elasticGpuAssociationId: Swift.String? @@ -39456,7 +39710,7 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Describes the association between an instance and an elastic inference accelerator. + /// Amazon Elastic Inference is no longer available. Describes the association between an instance and an elastic inference accelerator. public struct ElasticInferenceAcceleratorAssociation: Swift.Sendable { /// The Amazon Resource Name (ARN) of the elastic inference accelerator. public var elasticInferenceAcceleratorArn: Swift.String? @@ -40231,9 +40485,9 @@ extension EC2ClientTypes { public var currentInstanceBootMode: EC2ClientTypes.InstanceBootModeValues? /// Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance. public var ebsOptimized: Swift.Bool? - /// Deprecated. Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances. + /// Deprecated. Amazon Elastic Graphics reached end of life on January 8, 2024. public var elasticGpuAssociations: [EC2ClientTypes.ElasticGpuAssociation]? - /// The elastic inference accelerator associated with the instance. + /// Deprecated Amazon Elastic Inference is no longer available. public var elasticInferenceAcceleratorAssociations: [EC2ClientTypes.ElasticInferenceAcceleratorAssociation]? /// Specifies whether enhanced networking with ENA is enabled. public var enaSupport: Swift.Bool? @@ -41525,7 +41779,7 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Describes the memory available to the inference accelerator. + /// Amazon Elastic Inference is no longer available. Describes the memory available to the inference accelerator. public struct InferenceDeviceMemoryInfo: Swift.Sendable { /// The size of the memory available to the inference accelerator, in MiB. public var sizeInMiB: Swift.Int? @@ -41541,7 +41795,7 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Describes the Inference accelerators for the instance type. + /// Amazon Elastic Inference is no longer available. Describes the Inference accelerators for the instance type. public struct InferenceDeviceInfo: Swift.Sendable { /// The number of Inference accelerators for the instance type. public var count: Swift.Int? @@ -41569,7 +41823,7 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Describes the Inference accelerators for the instance type. + /// Amazon Elastic Inference is no longer available. Describes the Inference accelerators for the instance type. public struct InferenceAcceleratorInfo: Swift.Sendable { /// Describes the Inference accelerators for the instance type. public var accelerators: [EC2ClientTypes.InferenceDeviceInfo]? @@ -52866,6 +53120,40 @@ public struct DisassociateAddressInput: Swift.Sendable { } } +public struct DisassociateCapacityReservationBillingOwnerInput: Swift.Sendable { + /// The ID of the Capacity Reservation. + /// This member is required. + public var capacityReservationId: Swift.String? + /// Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. + public var dryRun: Swift.Bool? + /// The ID of the consumer account to which the request was sent. + /// This member is required. + public var unusedReservationBillingOwnerId: Swift.String? + + public init( + capacityReservationId: Swift.String? = nil, + dryRun: Swift.Bool? = nil, + unusedReservationBillingOwnerId: Swift.String? = nil + ) + { + self.capacityReservationId = capacityReservationId + self.dryRun = dryRun + self.unusedReservationBillingOwnerId = unusedReservationBillingOwnerId + } +} + +public struct DisassociateCapacityReservationBillingOwnerOutput: Swift.Sendable { + /// Returns true if the request succeeds; otherwise, it returns an error. + public var `return`: Swift.Bool? + + public init( + `return`: Swift.Bool? = nil + ) + { + self.`return` = `return` + } +} + public struct DisassociateClientVpnTargetNetworkInput: Swift.Sendable { /// The ID of the target network association. /// This member is required. @@ -64497,6 +64785,35 @@ public struct RegisterTransitGatewayMulticastGroupSourcesOutput: Swift.Sendable } } +public struct RejectCapacityReservationBillingOwnershipInput: Swift.Sendable { + /// The ID of the Capacity Reservation for which to reject the request. + /// This member is required. + public var capacityReservationId: Swift.String? + /// Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. + public var dryRun: Swift.Bool? + + public init( + capacityReservationId: Swift.String? = nil, + dryRun: Swift.Bool? = nil + ) + { + self.capacityReservationId = capacityReservationId + self.dryRun = dryRun + } +} + +public struct RejectCapacityReservationBillingOwnershipOutput: Swift.Sendable { + /// Returns true if the request succeeds; otherwise, it returns an error. + public var `return`: Swift.Bool? + + public init( + `return`: Swift.Bool? = nil + ) + { + self.`return` = `return` + } +} + public struct RejectTransitGatewayMulticastDomainAssociationsInput: Swift.Sendable { /// Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. public var dryRun: Swift.Bool? @@ -66042,7 +66359,7 @@ extension EC2ClientTypes { extension EC2ClientTypes { - /// Describes an elastic inference accelerator. + /// Amazon Elastic Inference is no longer available. Describes an elastic inference accelerator. public struct ElasticInferenceAccelerator: Swift.Sendable { /// The number of elastic inference accelerators to attach to the instance. Default: 1 public var count: Swift.Int? @@ -66305,7 +66622,7 @@ public struct RunInstancesInput: Swift.Sendable { public var ebsOptimized: Swift.Bool? /// An elastic GPU to associate with the instance. Amazon Elastic Graphics reached end of life on January 8, 2024. public var elasticGpuSpecification: [EC2ClientTypes.ElasticGpuSpecification]? - /// An elastic inference accelerator to associate with the instance. Amazon Elastic Inference (EI) is no longer available to new customers. For more information, see [Amazon Elastic Inference FAQs](http://aws.amazon.com/machine-learning/elastic-inference/faqs/). + /// An elastic inference accelerator to associate with the instance. Amazon Elastic Inference is no longer available. public var elasticInferenceAccelerators: [EC2ClientTypes.ElasticInferenceAccelerator]? /// If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address. public var enablePrimaryIpv6: Swift.Bool? @@ -67731,6 +68048,13 @@ extension AcceptAddressTransferInput { } } +extension AcceptCapacityReservationBillingOwnershipInput { + + static func urlPathProvider(_ value: AcceptCapacityReservationBillingOwnershipInput) -> Swift.String? { + return "/" + } +} + extension AcceptReservedInstancesExchangeQuoteInput { static func urlPathProvider(_ value: AcceptReservedInstancesExchangeQuoteInput) -> Swift.String? { @@ -67836,6 +68160,13 @@ extension AssociateAddressInput { } } +extension AssociateCapacityReservationBillingOwnerInput { + + static func urlPathProvider(_ value: AssociateCapacityReservationBillingOwnerInput) -> Swift.String? { + return "/" + } +} + extension AssociateClientVpnTargetNetworkInput { static func urlPathProvider(_ value: AssociateClientVpnTargetNetworkInput) -> Swift.String? { @@ -69348,6 +69679,13 @@ extension DescribeCapacityBlockOfferingsInput { } } +extension DescribeCapacityReservationBillingRequestsInput { + + static func urlPathProvider(_ value: DescribeCapacityReservationBillingRequestsInput) -> Swift.String? { + return "/" + } +} + extension DescribeCapacityReservationFleetsInput { static func urlPathProvider(_ value: DescribeCapacityReservationFleetsInput) -> Swift.String? { @@ -70503,6 +70841,13 @@ extension DisassociateAddressInput { } } +extension DisassociateCapacityReservationBillingOwnerInput { + + static func urlPathProvider(_ value: DisassociateCapacityReservationBillingOwnerInput) -> Swift.String? { + return "/" + } +} + extension DisassociateClientVpnTargetNetworkInput { static func urlPathProvider(_ value: DisassociateClientVpnTargetNetworkInput) -> Swift.String? { @@ -71742,6 +72087,13 @@ extension RegisterTransitGatewayMulticastGroupSourcesInput { } } +extension RejectCapacityReservationBillingOwnershipInput { + + static func urlPathProvider(_ value: RejectCapacityReservationBillingOwnershipInput) -> Swift.String? { + return "/" + } +} + extension RejectTransitGatewayMulticastDomainAssociationsInput { static func urlPathProvider(_ value: RejectTransitGatewayMulticastDomainAssociationsInput) -> Swift.String? { @@ -72134,6 +72486,17 @@ extension AcceptAddressTransferInput { } } +extension AcceptCapacityReservationBillingOwnershipInput { + + static func write(value: AcceptCapacityReservationBillingOwnershipInput?, to writer: SmithyFormURL.Writer) throws { + guard let value else { return } + try writer["CapacityReservationId"].write(value.capacityReservationId) + try writer["DryRun"].write(value.dryRun) + try writer["Action"].write("AcceptCapacityReservationBillingOwnership") + try writer["Version"].write("2016-11-15") + } +} + extension AcceptReservedInstancesExchangeQuoteInput { static func write(value: AcceptReservedInstancesExchangeQuoteInput?, to writer: SmithyFormURL.Writer) throws { @@ -72373,6 +72736,18 @@ extension AssociateAddressInput { } } +extension AssociateCapacityReservationBillingOwnerInput { + + static func write(value: AssociateCapacityReservationBillingOwnerInput?, to writer: SmithyFormURL.Writer) throws { + guard let value else { return } + try writer["CapacityReservationId"].write(value.capacityReservationId) + try writer["DryRun"].write(value.dryRun) + try writer["UnusedReservationBillingOwnerId"].write(value.unusedReservationBillingOwnerId) + try writer["Action"].write("AssociateCapacityReservationBillingOwner") + try writer["Version"].write("2016-11-15") + } +} + extension AssociateClientVpnTargetNetworkInput { static func write(value: AssociateClientVpnTargetNetworkInput?, to writer: SmithyFormURL.Writer) throws { @@ -75583,6 +75958,25 @@ extension DescribeCapacityBlockOfferingsInput { } } +extension DescribeCapacityReservationBillingRequestsInput { + + static func write(value: DescribeCapacityReservationBillingRequestsInput?, to writer: SmithyFormURL.Writer) throws { + guard let value else { return } + if !(value.capacityReservationIds?.isEmpty ?? true) { + try writer["CapacityReservationId"].writeList(value.capacityReservationIds, memberWritingClosure: SmithyReadWrite.WritingClosures.writeString(value:to:), memberNodeInfo: "Item", isFlattened: true) + } + try writer["DryRun"].write(value.dryRun) + if !(value.filters?.isEmpty ?? true) { + try writer["Filter"].writeList(value.filters, memberWritingClosure: EC2ClientTypes.Filter.write(value:to:), memberNodeInfo: "Filter", isFlattened: true) + } + try writer["MaxResults"].write(value.maxResults) + try writer["NextToken"].write(value.nextToken) + try writer["Role"].write(value.role) + try writer["Action"].write("DescribeCapacityReservationBillingRequests") + try writer["Version"].write("2016-11-15") + } +} + extension DescribeCapacityReservationFleetsInput { static func write(value: DescribeCapacityReservationFleetsInput?, to writer: SmithyFormURL.Writer) throws { @@ -78307,6 +78701,18 @@ extension DisassociateAddressInput { } } +extension DisassociateCapacityReservationBillingOwnerInput { + + static func write(value: DisassociateCapacityReservationBillingOwnerInput?, to writer: SmithyFormURL.Writer) throws { + guard let value else { return } + try writer["CapacityReservationId"].write(value.capacityReservationId) + try writer["DryRun"].write(value.dryRun) + try writer["UnusedReservationBillingOwnerId"].write(value.unusedReservationBillingOwnerId) + try writer["Action"].write("DisassociateCapacityReservationBillingOwner") + try writer["Version"].write("2016-11-15") + } +} + extension DisassociateClientVpnTargetNetworkInput { static func write(value: DisassociateClientVpnTargetNetworkInput?, to writer: SmithyFormURL.Writer) throws { @@ -80927,6 +81333,17 @@ extension RegisterTransitGatewayMulticastGroupSourcesInput { } } +extension RejectCapacityReservationBillingOwnershipInput { + + static func write(value: RejectCapacityReservationBillingOwnershipInput?, to writer: SmithyFormURL.Writer) throws { + guard let value else { return } + try writer["CapacityReservationId"].write(value.capacityReservationId) + try writer["DryRun"].write(value.dryRun) + try writer["Action"].write("RejectCapacityReservationBillingOwnership") + try writer["Version"].write("2016-11-15") + } +} + extension RejectTransitGatewayMulticastDomainAssociationsInput { static func write(value: RejectTransitGatewayMulticastDomainAssociationsInput?, to writer: SmithyFormURL.Writer) throws { @@ -81763,6 +82180,18 @@ extension AcceptAddressTransferOutput { } } +extension AcceptCapacityReservationBillingOwnershipOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> AcceptCapacityReservationBillingOwnershipOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyXML.Reader.from(data: data) + let reader = responseReader + var value = AcceptCapacityReservationBillingOwnershipOutput() + value.`return` = try reader["return"].readIfPresent() + return value + } +} + extension AcceptReservedInstancesExchangeQuoteOutput { static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> AcceptReservedInstancesExchangeQuoteOutput { @@ -81955,6 +82384,18 @@ extension AssociateAddressOutput { } } +extension AssociateCapacityReservationBillingOwnerOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> AssociateCapacityReservationBillingOwnerOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyXML.Reader.from(data: data) + let reader = responseReader + var value = AssociateCapacityReservationBillingOwnerOutput() + value.`return` = try reader["return"].readIfPresent() + return value + } +} + extension AssociateClientVpnTargetNetworkOutput { static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> AssociateClientVpnTargetNetworkOutput { @@ -84522,6 +84963,19 @@ extension DescribeCapacityBlockOfferingsOutput { } } +extension DescribeCapacityReservationBillingRequestsOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> DescribeCapacityReservationBillingRequestsOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyXML.Reader.from(data: data) + let reader = responseReader + var value = DescribeCapacityReservationBillingRequestsOutput() + value.capacityReservationBillingRequests = try reader["capacityReservationBillingRequestSet"].readListIfPresent(memberReadingClosure: EC2ClientTypes.CapacityReservationBillingRequest.read(from:), memberNodeInfo: "item", isFlattened: false) + value.nextToken = try reader["nextToken"].readIfPresent() + return value + } +} + extension DescribeCapacityReservationFleetsOutput { static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> DescribeCapacityReservationFleetsOutput { @@ -86664,6 +87118,18 @@ extension DisassociateAddressOutput { } } +extension DisassociateCapacityReservationBillingOwnerOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> DisassociateCapacityReservationBillingOwnerOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyXML.Reader.from(data: data) + let reader = responseReader + var value = DisassociateCapacityReservationBillingOwnerOutput() + value.`return` = try reader["return"].readIfPresent() + return value + } +} + extension DisassociateClientVpnTargetNetworkOutput { static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> DisassociateClientVpnTargetNetworkOutput { @@ -88864,6 +89330,18 @@ extension RegisterTransitGatewayMulticastGroupSourcesOutput { } } +extension RejectCapacityReservationBillingOwnershipOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> RejectCapacityReservationBillingOwnershipOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyXML.Reader.from(data: data) + let reader = responseReader + var value = RejectCapacityReservationBillingOwnershipOutput() + value.`return` = try reader["return"].readIfPresent() + return value + } +} + extension RejectTransitGatewayMulticastDomainAssociationsOutput { static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> RejectTransitGatewayMulticastDomainAssociationsOutput { @@ -89505,6 +89983,19 @@ enum AcceptAddressTransferOutputError { } } +enum AcceptCapacityReservationBillingOwnershipOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyXML.Reader.from(data: data) + let baseError = try AWSClientRuntime.EC2QueryError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + switch baseError.code { + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + enum AcceptReservedInstancesExchangeQuoteOutputError { static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { @@ -89700,6 +90191,19 @@ enum AssociateAddressOutputError { } } +enum AssociateCapacityReservationBillingOwnerOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyXML.Reader.from(data: data) + let baseError = try AWSClientRuntime.EC2QueryError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + switch baseError.code { + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + enum AssociateClientVpnTargetNetworkOutputError { static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { @@ -92508,6 +93012,19 @@ enum DescribeCapacityBlockOfferingsOutputError { } } +enum DescribeCapacityReservationBillingRequestsOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyXML.Reader.from(data: data) + let baseError = try AWSClientRuntime.EC2QueryError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + switch baseError.code { + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + enum DescribeCapacityReservationFleetsOutputError { static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { @@ -94653,6 +95170,19 @@ enum DisassociateAddressOutputError { } } +enum DisassociateCapacityReservationBillingOwnerOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyXML.Reader.from(data: data) + let baseError = try AWSClientRuntime.EC2QueryError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + switch baseError.code { + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + enum DisassociateClientVpnTargetNetworkOutputError { static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { @@ -96954,6 +97484,19 @@ enum RegisterTransitGatewayMulticastGroupSourcesOutputError { } } +enum RejectCapacityReservationBillingOwnershipOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyXML.Reader.from(data: data) + let baseError = try AWSClientRuntime.EC2QueryError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + switch baseError.code { + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + enum RejectTransitGatewayMulticastDomainAssociationsOutputError { static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { @@ -98554,6 +99097,7 @@ extension EC2ClientTypes.CapacityReservation { value.placementGroupArn = try reader["placementGroupArn"].readIfPresent() value.capacityAllocations = try reader["capacityAllocationSet"].readListIfPresent(memberReadingClosure: EC2ClientTypes.CapacityAllocation.read(from:), memberNodeInfo: "item", isFlattened: false) value.reservationType = try reader["reservationType"].readIfPresent() + value.unusedReservationBillingOwnerId = try reader["unusedReservationBillingOwnerId"].readIfPresent() return value } } @@ -101571,6 +102115,34 @@ extension EC2ClientTypes.CapacityBlockOffering { } } +extension EC2ClientTypes.CapacityReservationBillingRequest { + + static func read(from reader: SmithyXML.Reader) throws -> EC2ClientTypes.CapacityReservationBillingRequest { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = EC2ClientTypes.CapacityReservationBillingRequest() + value.capacityReservationId = try reader["capacityReservationId"].readIfPresent() + value.requestedBy = try reader["requestedBy"].readIfPresent() + value.unusedReservationBillingOwnerId = try reader["unusedReservationBillingOwnerId"].readIfPresent() + value.lastUpdateTime = try reader["lastUpdateTime"].readTimestampIfPresent(format: SmithyTimestamps.TimestampFormat.dateTime) + value.status = try reader["status"].readIfPresent() + value.statusMessage = try reader["statusMessage"].readIfPresent() + value.capacityReservationInfo = try reader["capacityReservationInfo"].readIfPresent(with: EC2ClientTypes.CapacityReservationInfo.read(from:)) + return value + } +} + +extension EC2ClientTypes.CapacityReservationInfo { + + static func read(from reader: SmithyXML.Reader) throws -> EC2ClientTypes.CapacityReservationInfo { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = EC2ClientTypes.CapacityReservationInfo() + value.instanceType = try reader["instanceType"].readIfPresent() + value.availabilityZone = try reader["availabilityZone"].readIfPresent() + value.tenancy = try reader["tenancy"].readIfPresent() + return value + } +} + extension EC2ClientTypes.CapacityReservationFleet { static func read(from reader: SmithyXML.Reader) throws -> EC2ClientTypes.CapacityReservationFleet { diff --git a/Sources/Services/AWSEC2/Sources/AWSEC2/Paginators.swift b/Sources/Services/AWSEC2/Sources/AWSEC2/Paginators.swift index 6c0c81d8de2..c3902ea99b9 100644 --- a/Sources/Services/AWSEC2/Sources/AWSEC2/Paginators.swift +++ b/Sources/Services/AWSEC2/Sources/AWSEC2/Paginators.swift @@ -175,6 +175,40 @@ extension PaginatorSequence where OperationStackInput == DescribeCapacityBlockOf return try await self.asyncCompactMap { item in item.capacityBlockOfferings } } } +extension EC2Client { + /// Paginate over `[DescribeCapacityReservationBillingRequestsOutput]` results. + /// + /// When this operation is called, an `AsyncSequence` is created. AsyncSequences are lazy so no service + /// calls are made until the sequence is iterated over. This also means there is no guarantee that the request is valid + /// until then. If there are errors in your request, you will see the failures only after you start iterating. + /// - Parameters: + /// - input: A `[DescribeCapacityReservationBillingRequestsInput]` to start pagination + /// - Returns: An `AsyncSequence` that can iterate over `DescribeCapacityReservationBillingRequestsOutput` + public func describeCapacityReservationBillingRequestsPaginated(input: DescribeCapacityReservationBillingRequestsInput) -> ClientRuntime.PaginatorSequence { + return ClientRuntime.PaginatorSequence(input: input, inputKey: \.nextToken, outputKey: \.nextToken, paginationFunction: self.describeCapacityReservationBillingRequests(input:)) + } +} + +extension DescribeCapacityReservationBillingRequestsInput: ClientRuntime.PaginateToken { + public func usingPaginationToken(_ token: Swift.String) -> DescribeCapacityReservationBillingRequestsInput { + return DescribeCapacityReservationBillingRequestsInput( + capacityReservationIds: self.capacityReservationIds, + dryRun: self.dryRun, + filters: self.filters, + maxResults: self.maxResults, + nextToken: token, + role: self.role + )} +} + +extension PaginatorSequence where OperationStackInput == DescribeCapacityReservationBillingRequestsInput, OperationStackOutput == DescribeCapacityReservationBillingRequestsOutput { + /// This paginator transforms the `AsyncSequence` returned by `describeCapacityReservationBillingRequestsPaginated` + /// to access the nested member `[EC2ClientTypes.CapacityReservationBillingRequest]` + /// - Returns: `[EC2ClientTypes.CapacityReservationBillingRequest]` + public func capacityReservationBillingRequests() async throws -> [EC2ClientTypes.CapacityReservationBillingRequest] { + return try await self.asyncCompactMap { item in item.capacityReservationBillingRequests } + } +} extension EC2Client { /// Paginate over `[DescribeCapacityReservationFleetsOutput]` results. /// diff --git a/Sources/Services/AWSECS/Sources/AWSECS/ECSClient.swift b/Sources/Services/AWSECS/Sources/AWSECS/ECSClient.swift index 02de94ed660..76740b13258 100644 --- a/Sources/Services/AWSECS/Sources/AWSECS/ECSClient.swift +++ b/Sources/Services/AWSECS/Sources/AWSECS/ECSClient.swift @@ -348,14 +348,14 @@ extension ECSClient { /// Performs the `CreateService` operation on the `AmazonEC2ContainerServiceV20141113` service. /// - /// Runs and maintains your desired number of tasks from a specified task definition. If the number of tasks running in a service drops below the desiredCount, Amazon ECS runs another copy of the task in the specified cluster. To update an existing service, use [UpdateService](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateService.html). On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition. In addition to maintaining the desired count of tasks in your service, you can optionally run your service behind one or more load balancers. The load balancers distribute traffic across the tasks that are associated with the service. For more information, see [Service load balancing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) in the Amazon Elastic Container Service Developer Guide. You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a service. volumeConfigurations is only supported for REPLICA service and not DAEMON service. For more infomation, see [Amazon EBS volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the Amazon Elastic Container Service Developer Guide. Tasks for services that don't use a load balancer are considered healthy if they're in the RUNNING state. Tasks for services that use a load balancer are considered healthy if they're in the RUNNING state and are reported as healthy by the load balancer. There are two service scheduler strategies available: + /// Runs and maintains your desired number of tasks from a specified task definition. If the number of tasks running in a service drops below the desiredCount, Amazon ECS runs another copy of the task in the specified cluster. To update an existing service, use [UpdateService](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateService.html). On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition. Amazon Elastic Inference (EI) is no longer available to customers. In addition to maintaining the desired count of tasks in your service, you can optionally run your service behind one or more load balancers. The load balancers distribute traffic across the tasks that are associated with the service. For more information, see [Service load balancing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html) in the Amazon Elastic Container Service Developer Guide. You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a service. volumeConfigurations is only supported for REPLICA service and not DAEMON service. For more infomation, see [Amazon EBS volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the Amazon Elastic Container Service Developer Guide. Tasks for services that don't use a load balancer are considered healthy if they're in the RUNNING state. Tasks for services that use a load balancer are considered healthy if they're in the RUNNING state and are reported as healthy by the load balancer. There are two service scheduler strategies available: /// /// * REPLICA - The replica scheduling strategy places and maintains your desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions. For more information, see [Service scheduler concepts](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html) in the Amazon Elastic Container Service Developer Guide. /// /// * DAEMON - The daemon scheduling strategy deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. The service scheduler also evaluates the task placement constraints for running tasks. It also stops tasks that don't meet the placement constraints. When using this strategy, you don't need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies. For more information, see [Service scheduler concepts](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html) in the Amazon Elastic Container Service Developer Guide. /// /// - /// You can optionally specify a deployment configuration for your service. The deployment is initiated by changing properties. For example, the deployment might be initiated by the task definition or by your desired count of a service. You can use [UpdateService](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateService.html). The default value for a replica service for minimumHealthyPercent is 100%. The default value for a daemon service for minimumHealthyPercent is 0%. If a service uses the ECS deployment controller, the minimum healthy percent represents a lower limit on the number of tasks in a service that must remain in the RUNNING state during a deployment. Specifically, it represents it as a percentage of your desired number of tasks (rounded up to the nearest integer). This happens when any of your container instances are in the DRAINING state if the service contains tasks using the EC2 launch type. Using this parameter, you can deploy without using additional cluster capacity. For example, if you set your service to have desired number of four tasks and a minimum healthy percent of 50%, the scheduler might stop two existing tasks to free up cluster capacity before starting two new tasks. If they're in the RUNNING state, tasks for services that don't use a load balancer are considered healthy . If they're in the RUNNING state and reported as healthy by the load balancer, tasks for services that do use a load balancer are considered healthy . The default value for minimum healthy percent is 100%. If a service uses the ECS deployment controller, the maximum percent parameter represents an upper limit on the number of tasks in a service that are allowed in the RUNNING or PENDING state during a deployment. Specifically, it represents it as a percentage of the desired number of tasks (rounded down to the nearest integer). This happens when any of your container instances are in the DRAINING state if the service contains tasks using the EC2 launch type. Using this parameter, you can define the deployment batch size. For example, if your service has a desired number of four tasks and a maximum percent value of 200%, the scheduler may start four new tasks before stopping the four older tasks (provided that the cluster resources required to do this are available). The default value for maximum percent is 200%. If a service uses either the CODE_DEPLOY or EXTERNAL deployment controller types and tasks that use the EC2 launch type, the minimum healthy percent and maximum percent values are used only to define the lower and upper limit on the number of the tasks in the service that remain in the RUNNING state. This is while the container instances are in the DRAINING state. If the tasks in the service use the Fargate launch type, the minimum healthy percent and maximum percent values aren't used. This is the case even if they're currently visible when describing your service. When creating a service that uses the EXTERNAL deployment controller, you can specify only parameters that aren't controlled at the task set level. The only required parameter is the service name. You control your services using the [CreateTaskSet](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateTaskSet.html). For more information, see [Amazon ECS deployment types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the Amazon Elastic Container Service Developer Guide. When the service scheduler launches new tasks, it determines task placement. For information about task placement and task placement strategies, see [Amazon ECS task placement](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement.html) in the Amazon Elastic Container Service Developer Guide Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. + /// You can optionally specify a deployment configuration for your service. The deployment is initiated by changing properties. For example, the deployment might be initiated by the task definition or by your desired count of a service. You can use [UpdateService](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateService.html). The default value for a replica service for minimumHealthyPercent is 100%. The default value for a daemon service for minimumHealthyPercent is 0%. If a service uses the ECS deployment controller, the minimum healthy percent represents a lower limit on the number of tasks in a service that must remain in the RUNNING state during a deployment. Specifically, it represents it as a percentage of your desired number of tasks (rounded up to the nearest integer). This happens when any of your container instances are in the DRAINING state if the service contains tasks using the EC2 launch type. Using this parameter, you can deploy without using additional cluster capacity. For example, if you set your service to have desired number of four tasks and a minimum healthy percent of 50%, the scheduler might stop two existing tasks to free up cluster capacity before starting two new tasks. If they're in the RUNNING state, tasks for services that don't use a load balancer are considered healthy . If they're in the RUNNING state and reported as healthy by the load balancer, tasks for services that do use a load balancer are considered healthy . The default value for minimum healthy percent is 100%. If a service uses the ECS deployment controller, the maximum percent parameter represents an upper limit on the number of tasks in a service that are allowed in the RUNNING or PENDING state during a deployment. Specifically, it represents it as a percentage of the desired number of tasks (rounded down to the nearest integer). This happens when any of your container instances are in the DRAINING state if the service contains tasks using the EC2 launch type. Using this parameter, you can define the deployment batch size. For example, if your service has a desired number of four tasks and a maximum percent value of 200%, the scheduler may start four new tasks before stopping the four older tasks (provided that the cluster resources required to do this are available). The default value for maximum percent is 200%. If a service uses either the CODE_DEPLOY or EXTERNAL deployment controller types and tasks that use the EC2 launch type, the minimum healthy percent and maximum percent values are used only to define the lower and upper limit on the number of the tasks in the service that remain in the RUNNING state. This is while the container instances are in the DRAINING state. If the tasks in the service use the Fargate launch type, the minimum healthy percent and maximum percent values aren't used. This is the case even if they're currently visible when describing your service. When creating a service that uses the EXTERNAL deployment controller, you can specify only parameters that aren't controlled at the task set level. The only required parameter is the service name. You control your services using the [CreateTaskSet](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateTaskSet.html). For more information, see [Amazon ECS deployment types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the Amazon Elastic Container Service Developer Guide. When the service scheduler launches new tasks, it determines task placement. For information about task placement and task placement strategies, see [Amazon ECS task placement](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement.html) in the Amazon Elastic Container Service Developer Guide /// /// - Parameter CreateServiceInput : [no documentation found] /// @@ -3148,7 +3148,7 @@ extension ECSClient { /// Performs the `RunTask` operation on the `AmazonEC2ContainerServiceV20141113` service. /// - /// Starts a new task using the specified task definition. On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition. You can allow Amazon ECS to place tasks for you, or you can customize how Amazon ECS places tasks using placement constraints and placement strategies. For more information, see [Scheduling Tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) in the Amazon Elastic Container Service Developer Guide. Alternatively, you can use StartTask to use your own scheduler or place tasks manually on specific container instances. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a service. For more infomation, see [Amazon EBS volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the Amazon Elastic Container Service Developer Guide. The Amazon ECS API follows an eventual consistency model. This is because of the distributed nature of the system supporting the API. This means that the result of an API command you run that affects your Amazon ECS resources might not be immediately visible to all subsequent commands you run. Keep this in mind when you carry out an API command that immediately follows a previous API command. To manage eventual consistency, you can do the following: + /// Starts a new task using the specified task definition. On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition. Amazon Elastic Inference (EI) is no longer available to customers. You can allow Amazon ECS to place tasks for you, or you can customize how Amazon ECS places tasks using placement constraints and placement strategies. For more information, see [Scheduling Tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) in the Amazon Elastic Container Service Developer Guide. Alternatively, you can use StartTask to use your own scheduler or place tasks manually on specific container instances. You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a service. For more infomation, see [Amazon EBS volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the Amazon Elastic Container Service Developer Guide. The Amazon ECS API follows an eventual consistency model. This is because of the distributed nature of the system supporting the API. This means that the result of an API command you run that affects your Amazon ECS resources might not be immediately visible to all subsequent commands you run. Keep this in mind when you carry out an API command that immediately follows a previous API command. To manage eventual consistency, you can do the following: /// /// * Confirm the state of the resource before you run a command to modify it. Run the DescribeTasks command using an exponential backoff algorithm to ensure that you allow enough time for the previous command to propagate through the system. To do this, run the DescribeTasks command repeatedly, starting with a couple of seconds of wait time and increasing gradually up to five minutes of wait time. /// @@ -3238,7 +3238,7 @@ extension ECSClient { /// Performs the `StartTask` operation on the `AmazonEC2ContainerServiceV20141113` service. /// - /// Starts a new task from the specified task definition on the specified container instance or instances. On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. Alternatively, you can useRunTask to place tasks for you. For more information, see [Scheduling Tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) in the Amazon Elastic Container Service Developer Guide. You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a service. For more infomation, see [Amazon EBS volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the Amazon Elastic Container Service Developer Guide. + /// Starts a new task from the specified task definition on the specified container instance or instances. On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition. Amazon Elastic Inference (EI) is no longer available to customers. Alternatively, you can useRunTask to place tasks for you. For more information, see [Scheduling Tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) in the Amazon Elastic Container Service Developer Guide. You can attach Amazon EBS volumes to Amazon ECS tasks by configuring the volume when creating or updating a service. For more infomation, see [Amazon EBS volumes](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html#ebs-volume-types) in the Amazon Elastic Container Service Developer Guide. /// /// - Parameter StartTaskInput : [no documentation found] /// diff --git a/Sources/Services/AWSECS/Sources/AWSECS/Models.swift b/Sources/Services/AWSECS/Sources/AWSECS/Models.swift index 53bbbbfd0bd..f5561dcf158 100644 --- a/Sources/Services/AWSECS/Sources/AWSECS/Models.swift +++ b/Sources/Services/AWSECS/Sources/AWSECS/Models.swift @@ -735,7 +735,7 @@ extension ECSClientTypes { extension ECSClientTypes { - /// The details of a capacity provider strategy. A capacity provider strategy can be set when using the [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html)or [CreateCluster](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCluster.html) APIs or as the default capacity provider strategy for a cluster with the CreateCluster API. Only capacity providers that are already associated with a cluster and have an ACTIVE or UPDATING status can be used in a capacity provider strategy. The [PutClusterCapacityProviders](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutClusterCapacityProviders.html) API is used to associate a capacity provider with a cluster. If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created. New Auto Scaling group capacity providers can be created with the [CreateClusterCapacityProvider](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateClusterCapacityProvider.html) API operation. To use a Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT capacity providers. The Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used in a capacity provider strategy. With FARGATE_SPOT, you can run interruption tolerant tasks at a rate that's discounted compared to the FARGATE price. FARGATE_SPOT runs tasks on spare compute capacity. When Amazon Web Services needs the capacity back, your tasks are interrupted with a two-minute warning. FARGATE_SPOT only supports Linux tasks with the X86_64 architecture on platform version 1.3.0 or later. A capacity provider strategy may contain a maximum of 6 capacity providers. + /// The details of a capacity provider strategy. A capacity provider strategy can be set when using the [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html)or [CreateCluster](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCluster.html) APIs or as the default capacity provider strategy for a cluster with the CreateCluster API. Only capacity providers that are already associated with a cluster and have an ACTIVE or UPDATING status can be used in a capacity provider strategy. The [PutClusterCapacityProviders](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PutClusterCapacityProviders.html) API is used to associate a capacity provider with a cluster. If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created. New Auto Scaling group capacity providers can be created with the [CreateClusterCapacityProvider](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateClusterCapacityProvider.html) API operation. To use a Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT capacity providers. The Fargate capacity providers are available to all accounts and only need to be associated with a cluster to be used in a capacity provider strategy. With FARGATE_SPOT, you can run interruption tolerant tasks at a rate that's discounted compared to the FARGATE price. FARGATE_SPOT runs tasks on spare compute capacity. When Amazon Web Services needs the capacity back, your tasks are interrupted with a two-minute warning. FARGATE_SPOT supports Linux tasks with the X86_64 architecture on platform version 1.3.0 or later. FARGATE_SPOT supports Linux tasks with the ARM64 architecture on platform version 1.4.0 or later. A capacity provider strategy may contain a maximum of 6 capacity providers. public struct CapacityProviderStrategyItem: Swift.Sendable { /// The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of 0 is used. public var base: Swift.Int @@ -1678,7 +1678,7 @@ extension ECSClientTypes { /// The log driver to use for the container. For tasks on Fargate, the supported log drivers are awslogs, splunk, and awsfirelens. For tasks hosted on Amazon EC2 instances, the supported log drivers are awslogs, fluentd, gelf, json-file, journald, syslog, splunk, and awsfirelens. For more information about using the awslogs log driver, see [Send Amazon ECS logs to CloudWatch](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) in the Amazon Elastic Container Service Developer Guide. For more information about using the awsfirelens log driver, see [Send Amazon ECS logs to an Amazon Web Services service or Amazon Web Services Partner](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html). If you have a custom driver that isn't listed, you can fork the Amazon ECS container agent project that's [available on GitHub](https://github.com/aws/amazon-ecs-agent) and customize it to work with that driver. We encourage you to submit pull requests for changes that you would like to have included. However, we don't currently provide support for running modified copies of this software. /// This member is required. public var logDriver: ECSClientTypes.LogDriver? - /// The configuration options to send to the log driver. This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}' + /// The configuration options to send to the log driver. The options you can specify depend on the log driver. Some of the options you can specify when you use the awslogs log driver to route logs to Amazon CloudWatch include the following: awslogs-create-group Required: No Specify whether you want the log group to be created automatically. If this option isn't specified, it defaults to false. Your IAM policy must include the logs:CreateLogGroup permission before you attempt to use awslogs-create-group. awslogs-region Required: Yes Specify the Amazon Web Services Region that the awslogs log driver is to send your Docker logs to. You can choose to send all of your logs from clusters in different Regions to a single region in CloudWatch Logs. This is so that they're all visible in one location. Otherwise, you can separate them by Region for more granularity. Make sure that the specified log group exists in the Region that you specify with this option. awslogs-group Required: Yes Make sure to specify a log group that the awslogs log driver sends its log streams to. awslogs-stream-prefix Required: Yes, when using the Fargate launch type.Optional for the EC2 launch type, required for the Fargate launch type. Use the awslogs-stream-prefix option to associate a log stream with the specified prefix, the container name, and the ID of the Amazon ECS task that the container belongs to. If you specify a prefix with this option, then the log stream takes the format prefix-name/container-name/ecs-task-id. If you don't specify a prefix with this option, then the log stream is named after the container ID that's assigned by the Docker daemon on the container instance. Because it's difficult to trace logs back to the container that sent them with just the Docker container ID (which is only available on the container instance), we recommend that you specify a prefix with this option. For Amazon ECS services, you can use the service name as the prefix. Doing so, you can trace log streams to the service that the container belongs to, the name of the container that sent them, and the ID of the task that the container belongs to. You must specify a stream-prefix for your logs to have your logs appear in the Log pane when using the Amazon ECS console. awslogs-datetime-format Required: No This option defines a multiline start pattern in Python strftime format. A log message consists of a line that matches the pattern and any following lines that don’t match the pattern. The matched line is the delimiter between log messages. One example of a use case for using this format is for parsing output such as a stack dump, which might otherwise be logged in multiple entries. The correct pattern allows it to be captured in a single entry. For more information, see [awslogs-datetime-format](https://docs.docker.com/config/containers/logging/awslogs/#awslogs-datetime-format). You cannot configure both the awslogs-datetime-format and awslogs-multiline-pattern options. Multiline logging performs regular expression parsing and matching of all log messages. This might have a negative impact on logging performance. awslogs-multiline-pattern Required: No This option defines a multiline start pattern that uses a regular expression. A log message consists of a line that matches the pattern and any following lines that don’t match the pattern. The matched line is the delimiter between log messages. For more information, see [awslogs-multiline-pattern](https://docs.docker.com/config/containers/logging/awslogs/#awslogs-multiline-pattern). This option is ignored if awslogs-datetime-format is also configured. You cannot configure both the awslogs-datetime-format and awslogs-multiline-pattern options. Multiline logging performs regular expression parsing and matching of all log messages. This might have a negative impact on logging performance. mode Required: No Valid values: non-blocking | blocking This option defines the delivery mode of log messages from the container to CloudWatch Logs. The delivery mode you choose affects application availability when the flow of logs from container to CloudWatch is interrupted. If you use the blocking mode and the flow of logs to CloudWatch is interrupted, calls from container code to write to the stdout and stderr streams will block. The logging thread of the application will block as a result. This may cause the application to become unresponsive and lead to container healthcheck failure. If you use the non-blocking mode, the container's logs are instead stored in an in-memory intermediate buffer configured with the max-buffer-size option. This prevents the application from becoming unresponsive when logs cannot be sent to CloudWatch. We recommend using this mode if you want to ensure service availability and are okay with some log loss. For more information, see [Preventing log loss with non-blocking mode in the ]awslogs container log driver(http://aws.amazon.com/blogs/containers/preventing-log-loss-with-non-blocking-mode-in-the-awslogs-container-log-driver/). max-buffer-size Required: No Default value: 1m When non-blocking mode is used, the max-buffer-size log option controls the size of the buffer that's used for intermediate message storage. Make sure to specify an adequate buffer size based on your application. When the buffer fills up, further logs cannot be stored. Logs that cannot be stored are lost. To route logs using the splunk log router, you need to specify a splunk-token and a splunk-url. When you use the awsfirelens log router to route logs to an Amazon Web Services Service or Amazon Web Services Partner Network destination for log storage and analytics, you can set the log-driver-buffer-limit option to limit the number of events that are buffered in memory, before being sent to the log router container. It can help to resolve potential log loss issue because high throughput might result in memory running out for the buffer inside of Docker. Other options you can specify when using awsfirelens to route logs depend on the destination. When you export logs to Amazon Data Firehose, you can specify the Amazon Web Services Region with region and a name for the log stream with delivery_stream. When you export logs to Amazon Kinesis Data Streams, you can specify an Amazon Web Services Region with region and a data stream name with stream. When you export logs to Amazon OpenSearch Service, you can specify options like Name, Host (OpenSearch Service endpoint without protocol), Port, Index, Type, Aws_auth, Aws_region, Suppress_Type_Name, and tls. When you export logs to Amazon S3, you can specify the bucket using the bucket option. You can also specify region, total_file_size, upload_timeout, and use_put_object as options. This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}' public var options: [Swift.String: Swift.String]? /// The secrets to pass to the log configuration. For more information, see [Specifying sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) in the Amazon Elastic Container Service Developer Guide. public var secretOptions: [ECSClientTypes.Secret]? diff --git a/Sources/Services/AWSElasticInference/Sources/AWSElasticInference/ElasticInferenceClient.swift b/Sources/Services/AWSElasticInference/Sources/AWSElasticInference/ElasticInferenceClient.swift index 3a2d4ff03b5..f2190ee0f5d 100644 --- a/Sources/Services/AWSElasticInference/Sources/AWSElasticInference/ElasticInferenceClient.swift +++ b/Sources/Services/AWSElasticInference/Sources/AWSElasticInference/ElasticInferenceClient.swift @@ -195,7 +195,7 @@ extension ElasticInferenceClient { extension ElasticInferenceClient { /// Performs the `DescribeAcceleratorOfferings` operation on the `EC2MatterhornCfSoothsayerApiGatewayLambda` service. /// - /// Describes the locations in which a given accelerator type or set of types is present in a given region. February 15, 2023: Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. + /// Amazon Elastic Inference is no longer available. Describes the locations in which a given accelerator type or set of types is present in a given region. /// /// - Parameter DescribeAcceleratorOfferingsInput : [no documentation found] /// @@ -266,7 +266,7 @@ extension ElasticInferenceClient { /// Performs the `DescribeAcceleratorTypes` operation on the `EC2MatterhornCfSoothsayerApiGatewayLambda` service. /// - /// Describes the accelerator types available in a given region, as well as their characteristics, such as memory and throughput. February 15, 2023: Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. + /// Amazon Elastic Inference is no longer available. Describes the accelerator types available in a given region, as well as their characteristics, such as memory and throughput. /// /// - Parameter DescribeAcceleratorTypesInput : [no documentation found] /// @@ -332,7 +332,7 @@ extension ElasticInferenceClient { /// Performs the `DescribeAccelerators` operation on the `EC2MatterhornCfSoothsayerApiGatewayLambda` service. /// - /// Describes information over a provided set of accelerators belonging to an account. February 15, 2023: Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. + /// Amazon Elastic Inference is no longer available. Describes information over a provided set of accelerators belonging to an account. /// /// - Parameter DescribeAcceleratorsInput : [no documentation found] /// @@ -403,7 +403,7 @@ extension ElasticInferenceClient { /// Performs the `ListTagsForResource` operation on the `EC2MatterhornCfSoothsayerApiGatewayLambda` service. /// - /// Returns all tags of an Elastic Inference Accelerator. February 15, 2023: Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. + /// Amazon Elastic Inference is no longer available. Returns all tags of an Elastic Inference Accelerator. /// /// - Parameter ListTagsForResourceInput : [no documentation found] /// @@ -471,7 +471,7 @@ extension ElasticInferenceClient { /// Performs the `TagResource` operation on the `EC2MatterhornCfSoothsayerApiGatewayLambda` service. /// - /// Adds the specified tags to an Elastic Inference Accelerator. February 15, 2023: Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. + /// Amazon Elastic Inference is no longer available. Adds the specified tags to an Elastic Inference Accelerator. /// /// - Parameter TagResourceInput : [no documentation found] /// @@ -542,7 +542,7 @@ extension ElasticInferenceClient { /// Performs the `UntagResource` operation on the `EC2MatterhornCfSoothsayerApiGatewayLambda` service. /// - /// Removes the specified tags from an Elastic Inference Accelerator. February 15, 2023: Starting April 15, 2023, AWS will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. + /// Amazon Elastic Inference is no longer available. Removes the specified tags from an Elastic Inference Accelerator. /// /// - Parameter UntagResourceInput : [no documentation found] /// diff --git a/Sources/Services/AWSIoTFleetWise/Sources/AWSIoTFleetWise/Models.swift b/Sources/Services/AWSIoTFleetWise/Sources/AWSIoTFleetWise/Models.swift index b7a6e487aa0..61741a0f7d3 100644 --- a/Sources/Services/AWSIoTFleetWise/Sources/AWSIoTFleetWise/Models.swift +++ b/Sources/Services/AWSIoTFleetWise/Sources/AWSIoTFleetWise/Models.swift @@ -953,6 +953,11 @@ extension IoTFleetWiseClientTypes { } } +extension IoTFleetWiseClientTypes.ConditionBasedCollectionScheme: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "ConditionBasedCollectionScheme(conditionLanguageVersion: \(Swift.String(describing: conditionLanguageVersion)), minimumTriggerIntervalMs: \(Swift.String(describing: minimumTriggerIntervalMs)), triggerMode: \(Swift.String(describing: triggerMode)), expression: \"CONTENT_REDACTED\")"} +} + extension IoTFleetWiseClientTypes { /// Information about a collection scheme that uses a time period to decide how often to collect data. @@ -1241,6 +1246,7 @@ public struct CreateCampaignInput: Swift.Sendable { /// (Optional) How long (in milliseconds) to collect raw data after a triggering event initiates the collection. If it's not specified, 0 is used. Default: 0 public var postTriggerCollectionDuration: Swift.Int? /// (Optional) A number indicating the priority of one campaign over another campaign for a certain vehicle or fleet. A campaign with the lowest value is deployed to vehicles before any other campaigns. If it's not specified, 0 is used. Default: 0 + @available(*, deprecated, message: "priority is no longer used or needed as input") public var priority: Swift.Int? /// The Amazon Resource Name (ARN) of the signal catalog to associate with the campaign. /// This member is required. @@ -1295,6 +1301,11 @@ public struct CreateCampaignInput: Swift.Sendable { } } +extension CreateCampaignInput: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "CreateCampaignInput(collectionScheme: \(Swift.String(describing: collectionScheme)), compression: \(Swift.String(describing: compression)), dataDestinationConfigs: \(Swift.String(describing: dataDestinationConfigs)), description: \(Swift.String(describing: description)), diagnosticsMode: \(Swift.String(describing: diagnosticsMode)), expiryTime: \(Swift.String(describing: expiryTime)), name: \(Swift.String(describing: name)), postTriggerCollectionDuration: \(Swift.String(describing: postTriggerCollectionDuration)), priority: \(Swift.String(describing: priority)), signalCatalogArn: \(Swift.String(describing: signalCatalogArn)), spoolingMode: \(Swift.String(describing: spoolingMode)), startTime: \(Swift.String(describing: startTime)), tags: \(Swift.String(describing: tags)), targetArn: \(Swift.String(describing: targetArn)), dataExtraDimensions: \"CONTENT_REDACTED\", signalsToCollect: \"CONTENT_REDACTED\")"} +} + public struct CreateCampaignOutput: Swift.Sendable { /// The ARN of the created campaign. public var arn: Swift.String? @@ -1472,6 +1483,11 @@ public struct GetCampaignOutput: Swift.Sendable { } } +extension GetCampaignOutput: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "GetCampaignOutput(arn: \(Swift.String(describing: arn)), collectionScheme: \(Swift.String(describing: collectionScheme)), compression: \(Swift.String(describing: compression)), creationTime: \(Swift.String(describing: creationTime)), dataDestinationConfigs: \(Swift.String(describing: dataDestinationConfigs)), description: \(Swift.String(describing: description)), diagnosticsMode: \(Swift.String(describing: diagnosticsMode)), expiryTime: \(Swift.String(describing: expiryTime)), lastModificationTime: \(Swift.String(describing: lastModificationTime)), name: \(Swift.String(describing: name)), postTriggerCollectionDuration: \(Swift.String(describing: postTriggerCollectionDuration)), priority: \(Swift.String(describing: priority)), signalCatalogArn: \(Swift.String(describing: signalCatalogArn)), spoolingMode: \(Swift.String(describing: spoolingMode)), startTime: \(Swift.String(describing: startTime)), status: \(Swift.String(describing: status)), targetArn: \(Swift.String(describing: targetArn)), dataExtraDimensions: \"CONTENT_REDACTED\", signalsToCollect: \"CONTENT_REDACTED\")"} +} + public struct ListCampaignsInput: Swift.Sendable { /// The maximum number of items to return, between 1 and 100, inclusive. public var maxResults: Swift.Int? @@ -1631,6 +1647,11 @@ public struct UpdateCampaignInput: Swift.Sendable { } } +extension UpdateCampaignInput: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "UpdateCampaignInput(action: \(Swift.String(describing: action)), description: \(Swift.String(describing: description)), name: \(Swift.String(describing: name)), dataExtraDimensions: \"CONTENT_REDACTED\")"} +} + public struct UpdateCampaignOutput: Swift.Sendable { /// The Amazon Resource Name (ARN) of the campaign. public var arn: Swift.String? diff --git a/Sources/Services/AWSNeptuneGraph/Sources/AWSNeptuneGraph/Models.swift b/Sources/Services/AWSNeptuneGraph/Sources/AWSNeptuneGraph/Models.swift index d3b1b5ed080..77bbb4d82bd 100644 --- a/Sources/Services/AWSNeptuneGraph/Sources/AWSNeptuneGraph/Models.swift +++ b/Sources/Services/AWSNeptuneGraph/Sources/AWSNeptuneGraph/Models.swift @@ -2410,7 +2410,7 @@ public struct CreateGraphUsingImportTaskInput: Swift.Sendable { public var deletionProtection: Swift.Bool? /// If set to true, the task halts when an import error is encountered. If set to false, the task skips the data that caused the error and continues if possible. public var failOnError: Swift.Bool? - /// Specifies the format of S3 data to be imported. Valid values are CSV, which identifies the [Gremlin CSV format](https://docs.aws.amazon.com/neptune/latest/userguide/bulk-load-tutorial-format-gremlin.html) or OPENCYPHER, which identies the [openCypher load format](https://docs.aws.amazon.com/neptune/latest/userguide/bulk-load-tutorial-format-opencypher.html). + /// Specifies the format of S3 data to be imported. Valid values are CSV, which identifies the [Gremlin CSV format](https://docs.aws.amazon.com/neptune/latest/userguide/bulk-load-tutorial-format-gremlin.html), OPEN_CYPHER, which identifies the [openCypher load format](https://docs.aws.amazon.com/neptune/latest/userguide/bulk-load-tutorial-format-opencypher.html), or ntriples, which identifies the [RDF n-triples](https://docs.aws.amazon.com/neptune-analytics/latest/userguide/using-rdf-data.html) format. public var format: NeptuneGraphClientTypes.Format? /// A name for the new Neptune Analytics graph to be created. The name must contain from 1 to 63 letters, numbers, or hyphens, and its first character must be a letter. It cannot end with a hyphen or contain two consecutive hyphens. /// This member is required. diff --git a/Sources/Services/AWSOutposts/Sources/AWSOutposts/Models.swift b/Sources/Services/AWSOutposts/Sources/AWSOutposts/Models.swift index 8eb4dfa40e9..9e225af0781 100644 --- a/Sources/Services/AWSOutposts/Sources/AWSOutposts/Models.swift +++ b/Sources/Services/AWSOutposts/Sources/AWSOutposts/Models.swift @@ -1134,6 +1134,7 @@ extension OutpostsClientTypes { public enum OrderStatus: Swift.Sendable, Swift.Equatable, Swift.RawRepresentable, Swift.CaseIterable, Swift.Hashable { case cancelled case completed + case delivered case error case fulfilled case installing @@ -1148,6 +1149,7 @@ extension OutpostsClientTypes { return [ .cancelled, .completed, + .delivered, .error, .fulfilled, .installing, @@ -1168,6 +1170,7 @@ extension OutpostsClientTypes { switch self { case .cancelled: return "CANCELLED" case .completed: return "COMPLETED" + case .delivered: return "DELIVERED" case .error: return "ERROR" case .fulfilled: return "FULFILLED" case .installing: return "INSTALLING" @@ -1206,7 +1209,9 @@ extension OutpostsClientTypes { /// /// * PREPARING - Order is received and being prepared. /// - /// * IN_PROGRESS - Order is either being built, shipped, or installed. To get more details, see the line item status. + /// * IN_PROGRESS - Order is either being built or shipped. To get more details, see the line item status. + /// + /// * DELIVERED - Order was delivered to the Outpost site. /// /// * COMPLETED - Order is complete. /// @@ -2153,12 +2158,16 @@ extension OutpostsClientTypes { public struct InstanceTypeItem: Swift.Sendable { /// The instance type. public var instanceType: Swift.String? + /// The number of default VCPUs in an instance type. + public var vcpUs: Swift.Int? public init( - instanceType: Swift.String? = nil + instanceType: Swift.String? = nil, + vcpUs: Swift.Int? = nil ) { self.instanceType = instanceType + self.vcpUs = vcpUs } } } @@ -4852,6 +4861,7 @@ extension OutpostsClientTypes.InstanceTypeItem { guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } var value = OutpostsClientTypes.InstanceTypeItem() value.instanceType = try reader["InstanceType"].readIfPresent() + value.vcpUs = try reader["VCPUs"].readIfPresent() return value } } diff --git a/Sources/Services/AWSRoute53Resolver/Sources/AWSRoute53Resolver/Models.swift b/Sources/Services/AWSRoute53Resolver/Sources/AWSRoute53Resolver/Models.swift index 192b900ec65..5834cbd27e7 100644 --- a/Sources/Services/AWSRoute53Resolver/Sources/AWSRoute53Resolver/Models.swift +++ b/Sources/Services/AWSRoute53Resolver/Sources/AWSRoute53Resolver/Models.swift @@ -2038,7 +2038,7 @@ public struct CreateResolverQueryLogConfigInput: Swift.Sendable { public var creatorRequestId: Swift.String? /// The ARN of the resource that you want Resolver to send query logs. You can send query logs to an S3 bucket, a CloudWatch Logs log group, or a Kinesis Data Firehose delivery stream. Examples of valid values include the following: /// - /// * S3 bucket: arn:aws:s3:::examplebucket You can optionally append a file prefix to the end of the ARN. arn:aws:s3:::examplebucket/development/ + /// * S3 bucket: arn:aws:s3:::amzn-s3-demo-bucket You can optionally append a file prefix to the end of the ARN. arn:aws:s3:::amzn-s3-demo-bucket/development/ /// /// * CloudWatch Logs log group: arn:aws:logs:us-west-1:123456789012:log-group:/mystack-testgroup-12ABC1AB12A1:* /// @@ -2243,18 +2243,22 @@ extension Route53ResolverClientTypes { /// /// * None, which is treated as Do53. public var `protocol`: Route53ResolverClientTypes.ModelProtocol? + /// The Server Name Indication of the DoH server that you want to forward queries to. This is only used if the Protocol of the TargetAddress is DoH. + public var serverNameIndication: Swift.String? public init( ip: Swift.String? = nil, ipv6: Swift.String? = nil, port: Swift.Int? = nil, - `protocol`: Route53ResolverClientTypes.ModelProtocol? = nil + `protocol`: Route53ResolverClientTypes.ModelProtocol? = nil, + serverNameIndication: Swift.String? = nil ) { self.ip = ip self.ipv6 = ipv6 self.port = port self.`protocol` = `protocol` + self.serverNameIndication = serverNameIndication } } } @@ -4941,7 +4945,7 @@ public struct UpdateFirewallRuleInput: Swift.Sendable { /// /// * TXT: Verifies email senders and application-specific values. /// - /// * A query type you define by using the DNS type ID, for example 28 for AAAA. The values must be defined as TYPENUMBER, where the NUMBER can be 1-65334, for example, TYPE28. For more information, see [List of DNS record types](https://en.wikipedia.org/wiki/List_of_DNS_record_types). + /// * A query type you define by using the DNS type ID, for example 28 for AAAA. The values must be defined as TYPENUMBER, where the NUMBER can be 1-65334, for example, TYPE28. For more information, see [List of DNS record types](https://en.wikipedia.org/wiki/List_of_DNS_record_types). If you set up a firewall BLOCK rule with action NXDOMAIN on query type equals AAAA, this action will not be applied to synthetic IPv6 addresses generated when DNS64 is enabled. public var qtype: Swift.String? public init( @@ -8954,6 +8958,7 @@ extension Route53ResolverClientTypes.TargetAddress { try writer["Ipv6"].write(value.ipv6) try writer["Port"].write(value.port) try writer["Protocol"].write(value.`protocol`) + try writer["ServerNameIndication"].write(value.serverNameIndication) } static func read(from reader: SmithyJSON.Reader) throws -> Route53ResolverClientTypes.TargetAddress { @@ -8963,6 +8968,7 @@ extension Route53ResolverClientTypes.TargetAddress { value.port = try reader["Port"].readIfPresent() value.ipv6 = try reader["Ipv6"].readIfPresent() value.`protocol` = try reader["Protocol"].readIfPresent() + value.serverNameIndication = try reader["ServerNameIndication"].readIfPresent() return value } } diff --git a/Sources/Services/AWSSocialMessaging/Package.swift.txt b/Sources/Services/AWSSocialMessaging/Package.swift.txt new file mode 100644 index 00000000000..e125f23780c --- /dev/null +++ b/Sources/Services/AWSSocialMessaging/Package.swift.txt @@ -0,0 +1,99 @@ +// swift-tools-version: 5.9.0 + +import PackageDescription + +let package = Package( + name: "AWSSocialMessaging", + platforms: [ + .macOS(.v10_15), .iOS(.v13) + ], + products: [ + .library(name: "AWSSocialMessaging", targets: ["AWSSocialMessaging"]) + ], + dependencies: [ + .package( + id: "aws-sdk-swift.smithy-swift", + exact: "0.0.1" + ), + .package( + id: "aws-sdk-swift.AWSClientRuntime", + exact: "0.0.1" + ), + .package( + id: "aws-sdk-swift.AWSSDKHTTPAuth", + exact: "0.0.1" + ), + ], + targets: [ + .target( + name: "AWSSocialMessaging", + dependencies: [ + .product( + name: "SmithyHTTPAuthAPI", + package: "aws-sdk-swift.smithy-swift" + ), + .product( + name: "Smithy", + package: "aws-sdk-swift.smithy-swift" + ), + .product( + name: "ClientRuntime", + package: "aws-sdk-swift.smithy-swift" + ), + .product( + name: "SmithyHTTPAPI", + package: "aws-sdk-swift.smithy-swift" + ), + .product( + name: "AWSClientRuntime", + package: "aws-sdk-swift.AWSClientRuntime" + ), + .product( + name: "SmithyJSON", + package: "aws-sdk-swift.smithy-swift" + ), + .product( + name: "SmithyReadWrite", + package: "aws-sdk-swift.smithy-swift" + ), + .product( + name: "SmithyTimestamps", + package: "aws-sdk-swift.smithy-swift" + ), + .product( + name: "AWSSDKHTTPAuth", + package: "aws-sdk-swift.AWSSDKHTTPAuth" + ), + .product( + name: "SmithyIdentity", + package: "aws-sdk-swift.smithy-swift" + ), + .product( + name: "SmithyRetriesAPI", + package: "aws-sdk-swift.smithy-swift" + ), + .product( + name: "SmithyRetries", + package: "aws-sdk-swift.smithy-swift" + ), + .product( + name: "SmithyTestUtil", + package: "aws-sdk-swift.smithy-swift" + ), + ], + resources: [ + .process("Resources") + ] + ), + .testTarget( + name: "AWSSocialMessagingTests", + dependencies: [ + "AWSSocialMessaging", + .product( + name: "SmithyTestUtil", + package: "aws-sdk-swift.smithy-swift" + ), + ] + ) + ] +) diff --git a/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/AuthSchemeResolver.swift b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/AuthSchemeResolver.swift new file mode 100644 index 00000000000..ed40c6f4c22 --- /dev/null +++ b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/AuthSchemeResolver.swift @@ -0,0 +1,56 @@ +// +// 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 class Smithy.Context +import enum Smithy.ClientError +import enum SmithyHTTPAuthAPI.SigningPropertyKeys +import protocol SmithyHTTPAuthAPI.AuthSchemeResolver +import protocol SmithyHTTPAuthAPI.AuthSchemeResolverParameters +import struct SmithyHTTPAuthAPI.AuthOption + +public struct SocialMessagingAuthSchemeResolverParameters: SmithyHTTPAuthAPI.AuthSchemeResolverParameters { + public let operation: Swift.String + // Region is used for SigV4 auth scheme + public let region: Swift.String? +} + +public protocol SocialMessagingAuthSchemeResolver: SmithyHTTPAuthAPI.AuthSchemeResolver { + // Intentionally empty. + // This is the parent protocol that all auth scheme resolver implementations of + // the service SocialMessaging must conform to. +} + +public struct DefaultSocialMessagingAuthSchemeResolver: SocialMessagingAuthSchemeResolver { + + public func resolveAuthScheme(params: SmithyHTTPAuthAPI.AuthSchemeResolverParameters) throws -> [SmithyHTTPAuthAPI.AuthOption] { + var validAuthOptions = [SmithyHTTPAuthAPI.AuthOption]() + guard let serviceParams = params as? SocialMessagingAuthSchemeResolverParameters else { + throw Smithy.ClientError.authError("Service specific auth scheme parameters type must be passed to auth scheme resolver.") + } + switch serviceParams.operation { + default: + var sigV4Option = SmithyHTTPAuthAPI.AuthOption(schemeID: "aws.auth#sigv4") + sigV4Option.signingProperties.set(key: SmithyHTTPAuthAPI.SigningPropertyKeys.signingName, value: "social-messaging") + guard let region = serviceParams.region else { + throw Smithy.ClientError.authError("Missing region in auth scheme parameters for SigV4 auth scheme.") + } + sigV4Option.signingProperties.set(key: SmithyHTTPAuthAPI.SigningPropertyKeys.signingRegion, value: region) + validAuthOptions.append(sigV4Option) + } + return validAuthOptions + } + + public func constructParameters(context: Smithy.Context) throws -> SmithyHTTPAuthAPI.AuthSchemeResolverParameters { + guard let opName = context.getOperation() else { + throw Smithy.ClientError.dataNotFound("Operation name not configured in middleware context for auth scheme resolver params construction.") + } + let opRegion = context.getRegion() + return SocialMessagingAuthSchemeResolverParameters(operation: opName, region: opRegion) + } +} diff --git a/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Endpoints.swift b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Endpoints.swift new file mode 100644 index 00000000000..cb43ef1f34f --- /dev/null +++ b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Endpoints.swift @@ -0,0 +1,73 @@ +// +// 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 class ClientRuntime.EndpointsRequestContext +import let AWSClientRuntime.awsPartitionJSON +import protocol ClientRuntime.EndpointsRequestContextProviding +import struct ClientRuntime.DefaultEndpointResolver +import struct ClientRuntime.StaticEndpointResolver +import struct SmithyHTTPAPI.Endpoint + +public struct EndpointParams { + /// Override the endpoint used to send this request + public let endpoint: Swift.String? + /// The AWS region used to dispatch the request. + public let region: Swift.String? + /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error. + public let useDualStack: Swift.Bool + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + public let useFIPS: Swift.Bool + + public init( + endpoint: Swift.String? = nil, + region: Swift.String? = nil, + useDualStack: Swift.Bool = false, + useFIPS: Swift.Bool = false + ) + { + self.endpoint = endpoint + self.region = region + self.useDualStack = useDualStack + self.useFIPS = useFIPS + } +} + +extension EndpointParams: ClientRuntime.EndpointsRequestContextProviding { + + public var context: ClientRuntime.EndpointsRequestContext { + get throws { + let context = try ClientRuntime.EndpointsRequestContext() + try context.add(name: "Endpoint", value: self.endpoint) + try context.add(name: "Region", value: self.region) + try context.add(name: "UseDualStack", value: self.useDualStack) + try context.add(name: "UseFIPS", value: self.useFIPS) + return context + } + } +} + +public protocol EndpointResolver { + func resolve(params: EndpointParams) throws -> SmithyHTTPAPI.Endpoint +} + +typealias DefaultEndpointResolver = ClientRuntime.DefaultEndpointResolver + +extension DefaultEndpointResolver { + private static let ruleSet = "{\"version\":\"1.0\",\"parameters\":{\"Region\":{\"builtIn\":\"AWS::Region\",\"required\":false,\"documentation\":\"The AWS region used to dispatch the request.\",\"type\":\"String\"},\"UseDualStack\":{\"builtIn\":\"AWS::UseDualStack\",\"required\":true,\"default\":false,\"documentation\":\"When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.\",\"type\":\"Boolean\"},\"UseFIPS\":{\"builtIn\":\"AWS::UseFIPS\",\"required\":true,\"default\":false,\"documentation\":\"When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.\",\"type\":\"Boolean\"},\"Endpoint\":{\"builtIn\":\"SDK::Endpoint\",\"required\":false,\"documentation\":\"Override the endpoint used to send this request\",\"type\":\"String\"}},\"rules\":[{\"conditions\":[{\"fn\":\"isSet\",\"argv\":[{\"ref\":\"Endpoint\"}]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},true]}],\"error\":\"Invalid Configuration: FIPS and custom endpoint are not supported\",\"type\":\"error\"},{\"conditions\":[],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},true]}],\"error\":\"Invalid Configuration: Dualstack and custom endpoint are not supported\",\"type\":\"error\"},{\"conditions\":[],\"endpoint\":{\"url\":{\"ref\":\"Endpoint\"},\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"}],\"type\":\"tree\"},{\"conditions\":[],\"rules\":[{\"conditions\":[{\"fn\":\"isSet\",\"argv\":[{\"ref\":\"Region\"}]}],\"rules\":[{\"conditions\":[{\"fn\":\"aws.partition\",\"argv\":[{\"ref\":\"Region\"}],\"assign\":\"PartitionResult\"}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},true]},{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},true]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[true,{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsFIPS\"]}]},{\"fn\":\"booleanEquals\",\"argv\":[true,{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsDualStack\"]}]}],\"rules\":[{\"conditions\":[],\"rules\":[{\"conditions\":[],\"endpoint\":{\"url\":\"https://social-messaging-fips.{Region}.{PartitionResult#dualStackDnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"FIPS and DualStack are enabled, but this partition does not support one or both\",\"type\":\"error\"}],\"type\":\"tree\"},{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseFIPS\"},true]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsFIPS\"]},true]}],\"rules\":[{\"conditions\":[],\"rules\":[{\"conditions\":[],\"endpoint\":{\"url\":\"https://social-messaging-fips.{Region}.{PartitionResult#dnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"FIPS is enabled but this partition does not support FIPS\",\"type\":\"error\"}],\"type\":\"tree\"},{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[{\"ref\":\"UseDualStack\"},true]}],\"rules\":[{\"conditions\":[{\"fn\":\"booleanEquals\",\"argv\":[true,{\"fn\":\"getAttr\",\"argv\":[{\"ref\":\"PartitionResult\"},\"supportsDualStack\"]}]}],\"rules\":[{\"conditions\":[],\"rules\":[{\"conditions\":[],\"endpoint\":{\"url\":\"https://social-messaging.{Region}.{PartitionResult#dualStackDnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"DualStack is enabled but this partition does not support DualStack\",\"type\":\"error\"}],\"type\":\"tree\"},{\"conditions\":[],\"rules\":[{\"conditions\":[],\"endpoint\":{\"url\":\"https://social-messaging.{Region}.{PartitionResult#dnsSuffix}\",\"properties\":{},\"headers\":{}},\"type\":\"endpoint\"}],\"type\":\"tree\"}],\"type\":\"tree\"}],\"type\":\"tree\"},{\"conditions\":[],\"error\":\"Invalid Configuration: Missing Region\",\"type\":\"error\"}],\"type\":\"tree\"}]}" + + init() throws { + try self.init(partitions: AWSClientRuntime.awsPartitionJSON, ruleSet: Self.ruleSet) + } +} + +extension DefaultEndpointResolver: EndpointResolver {} + +typealias StaticEndpointResolver = ClientRuntime.StaticEndpointResolver + +extension StaticEndpointResolver: EndpointResolver {} diff --git a/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Models.swift b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Models.swift new file mode 100644 index 00000000000..22e77819258 --- /dev/null +++ b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Models.swift @@ -0,0 +1,2075 @@ +// +// 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! + +@_spi(SmithyReadWrite) import ClientRuntime +import Foundation +import class SmithyHTTPAPI.HTTPResponse +@_spi(SmithyReadWrite) import class SmithyJSON.Reader +@_spi(SmithyReadWrite) import class SmithyJSON.Writer +import enum ClientRuntime.ErrorFault +import enum Smithy.ClientError +import enum SmithyReadWrite.ReaderError +@_spi(SmithyReadWrite) import enum SmithyReadWrite.WritingClosures +@_spi(SmithyTimestamps) import enum SmithyTimestamps.TimestampFormat +import protocol AWSClientRuntime.AWSServiceError +import protocol ClientRuntime.HTTPError +import protocol ClientRuntime.ModeledError +@_spi(SmithyReadWrite) import protocol SmithyReadWrite.SmithyReader +@_spi(SmithyReadWrite) import protocol SmithyReadWrite.SmithyWriter +@_spi(SmithyReadWrite) import struct AWSClientRuntime.RestJSONError +@_spi(UnknownAWSHTTPServiceError) import struct AWSClientRuntime.UnknownAWSHTTPServiceError +import struct Smithy.URIQueryItem +@_spi(SmithyTimestamps) import struct SmithyTimestamps.TimestampFormatter + +/// You do not have sufficient access to perform this action. +public struct AccessDeniedByMetaException: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { + + public struct Properties { + public internal(set) var message: Swift.String? = nil + } + + public internal(set) var properties = Properties() + public static var typeName: Swift.String { "AccessDeniedByMetaException" } + public static var fault: ClientRuntime.ErrorFault { .client } + public static var isRetryable: Swift.Bool { false } + public static var isThrottling: Swift.Bool { false } + public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() + public internal(set) var message: Swift.String? + public internal(set) var requestID: Swift.String? + + public init( + message: Swift.String? = nil + ) + { + self.properties.message = message + } +} + +/// You do not have sufficient access to perform this action. +public struct AccessDeniedException: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { + + public struct Properties { + public internal(set) var message: Swift.String? = nil + } + + public internal(set) var properties = Properties() + public static var typeName: Swift.String { "AccessDeniedException" } + public static var fault: ClientRuntime.ErrorFault { .client } + public static var isRetryable: Swift.Bool { false } + public static var isThrottling: Swift.Bool { false } + public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() + public internal(set) var message: Swift.String? + public internal(set) var requestID: Swift.String? + + public init( + message: Swift.String? = nil + ) + { + self.properties.message = message + } +} + +/// Thrown when performing an action because a dependency would be broken. +public struct DependencyException: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { + + public struct Properties { + public internal(set) var message: Swift.String? = nil + } + + public internal(set) var properties = Properties() + public static var typeName: Swift.String { "DependencyException" } + public static var fault: ClientRuntime.ErrorFault { .server } + public static var isRetryable: Swift.Bool { true } + public static var isThrottling: Swift.Bool { false } + public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() + public internal(set) var message: Swift.String? + public internal(set) var requestID: Swift.String? + + public init( + message: Swift.String? = nil + ) + { + self.properties.message = message + } +} + +/// One or more parameters provided to the action are not valid. +public struct InvalidParametersException: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { + + public struct Properties { + public internal(set) var message: Swift.String? = nil + } + + public internal(set) var properties = Properties() + public static var typeName: Swift.String { "InvalidParametersException" } + public static var fault: ClientRuntime.ErrorFault { .client } + public static var isRetryable: Swift.Bool { false } + public static var isThrottling: Swift.Bool { false } + public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() + public internal(set) var message: Swift.String? + public internal(set) var requestID: Swift.String? + + public init( + message: Swift.String? = nil + ) + { + self.properties.message = message + } +} + +/// The request was denied due to request throttling. +public struct ThrottledRequestException: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { + + public struct Properties { + public internal(set) var message: Swift.String? = nil + } + + public internal(set) var properties = Properties() + public static var typeName: Swift.String { "ThrottledRequestException" } + public static var fault: ClientRuntime.ErrorFault { .client } + public static var isRetryable: Swift.Bool { true } + public static var isThrottling: Swift.Bool { false } + public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() + public internal(set) var message: Swift.String? + public internal(set) var requestID: Swift.String? + + public init( + message: Swift.String? = nil + ) + { + self.properties.message = message + } +} + +extension SocialMessagingClientTypes { + + /// The tag for a resource. + public struct Tag: Swift.Sendable { + /// The tag key. + /// This member is required. + public var key: Swift.String? + /// The tag value. + public var value: Swift.String? + + public init( + key: Swift.String? = nil, + value: Swift.String? = nil + ) + { + self.key = key + self.value = value + } + } +} + +extension SocialMessagingClientTypes { + + /// The registration details for a linked phone number. + public struct WabaPhoneNumberSetupFinalization: Swift.Sendable { + /// The two letter ISO region for the location of where Meta will store data. Asia–Pacific (APAC) + /// + /// * Australia AU + /// + /// * Indonesia ID + /// + /// * India IN + /// + /// * Japan JP + /// + /// * Singapore SG + /// + /// * South Korea KR + /// + /// + /// Europe + /// + /// * Germany DE + /// + /// * Switzerland CH + /// + /// * United Kingdom GB + /// + /// + /// Latin America (LATAM) + /// + /// * Brazil BR + /// + /// + /// Middle East and Africa (MEA) + /// + /// * Bahrain BH + /// + /// * South Africa ZA + /// + /// * United Arab Emirates AE + /// + /// + /// North America (NORAM) + /// + /// * Canada CA + public var dataLocalizationRegion: Swift.String? + /// The unique identifier of the originating phone number associated with the media. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use [GetLinkedWhatsAppBusinessAccount](https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_GetLinkedWhatsAppBusinessAccountPhoneNumber.html) to find a phone number's id. + /// This member is required. + public var id: Swift.String? + /// An array of key and value pair tags. + public var tags: [SocialMessagingClientTypes.Tag]? + /// The PIN to use for two-step verification. To reset your PIN follow the directions in [Updating PIN](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/two-step-verification/#updating-pin) in the WhatsApp Business Platform Cloud API Reference. + /// This member is required. + public var twoFactorPin: Swift.String? + + public init( + dataLocalizationRegion: Swift.String? = nil, + id: Swift.String? = nil, + tags: [SocialMessagingClientTypes.Tag]? = nil, + twoFactorPin: Swift.String? = nil + ) + { + self.dataLocalizationRegion = dataLocalizationRegion + self.id = id + self.tags = tags + self.twoFactorPin = twoFactorPin + } + } +} + +extension SocialMessagingClientTypes.WabaPhoneNumberSetupFinalization: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "WabaPhoneNumberSetupFinalization(dataLocalizationRegion: \(Swift.String(describing: dataLocalizationRegion)), id: \(Swift.String(describing: id)), tags: \(Swift.String(describing: tags)), twoFactorPin: \"CONTENT_REDACTED\")"} +} + +extension SocialMessagingClientTypes { + + /// Contains information on the event destination. + public struct WhatsAppBusinessAccountEventDestination: Swift.Sendable { + /// The ARN of the event destination. + /// This member is required. + public var eventDestinationArn: Swift.String? + + public init( + eventDestinationArn: Swift.String? = nil + ) + { + self.eventDestinationArn = eventDestinationArn + } + } +} + +extension SocialMessagingClientTypes { + + /// The registration details for a linked WhatsApp Business Account. + public struct WabaSetupFinalization: Swift.Sendable { + /// The event destinations for the linked WhatsApp Business Account. + public var eventDestinations: [SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination]? + /// The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901. + public var id: Swift.String? + /// An array of key and value pair tags. + public var tags: [SocialMessagingClientTypes.Tag]? + + public init( + eventDestinations: [SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination]? = nil, + id: Swift.String? = nil, + tags: [SocialMessagingClientTypes.Tag]? = nil + ) + { + self.eventDestinations = eventDestinations + self.id = id + self.tags = tags + } + } +} + +extension SocialMessagingClientTypes { + + /// The details of linking a WhatsApp Business Account to your Amazon Web Services account. + public struct WhatsAppSetupFinalization: Swift.Sendable { + /// An Amazon Web Services access token generated by WhatsAppSignupCallback and used by WhatsAppSetupFinalization. + /// This member is required. + public var associateInProgressToken: Swift.String? + /// Used to add a new phone number to an existing WhatsApp Business Account. This field can't be used when the waba field is present. + public var phoneNumberParent: Swift.String? + /// An array of WabaPhoneNumberSetupFinalization objects containing the details of each phone number associated with the WhatsApp Business Account. + /// This member is required. + public var phoneNumbers: [SocialMessagingClientTypes.WabaPhoneNumberSetupFinalization]? + /// Used to create a new WhatsApp Business Account and add a phone number. This field can't be used when the phoneNumberParent field is present. + public var waba: SocialMessagingClientTypes.WabaSetupFinalization? + + public init( + associateInProgressToken: Swift.String? = nil, + phoneNumberParent: Swift.String? = nil, + phoneNumbers: [SocialMessagingClientTypes.WabaPhoneNumberSetupFinalization]? = nil, + waba: SocialMessagingClientTypes.WabaSetupFinalization? = nil + ) + { + self.associateInProgressToken = associateInProgressToken + self.phoneNumberParent = phoneNumberParent + self.phoneNumbers = phoneNumbers + self.waba = waba + } + } +} + +extension SocialMessagingClientTypes.WhatsAppSetupFinalization: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "WhatsAppSetupFinalization(phoneNumberParent: \(Swift.String(describing: phoneNumberParent)), phoneNumbers: \(Swift.String(describing: phoneNumbers)), waba: \(Swift.String(describing: waba)), associateInProgressToken: \"CONTENT_REDACTED\")"} +} + +extension SocialMessagingClientTypes { + + /// Contains the accessToken provided by Meta during signup. + public struct WhatsAppSignupCallback: Swift.Sendable { + /// The access token for your WhatsApp Business Account. The accessToken value is provided by Meta. + /// This member is required. + public var accessToken: Swift.String? + + public init( + accessToken: Swift.String? = nil + ) + { + self.accessToken = accessToken + } + } +} + +public struct AssociateWhatsAppBusinessAccountInput: Swift.Sendable { + /// A JSON object that contains the phone numbers and WhatsApp Business Account to link to your account. + public var setupFinalization: SocialMessagingClientTypes.WhatsAppSetupFinalization? + /// Contains the callback access token. + public var signupCallback: SocialMessagingClientTypes.WhatsAppSignupCallback? + + public init( + setupFinalization: SocialMessagingClientTypes.WhatsAppSetupFinalization? = nil, + signupCallback: SocialMessagingClientTypes.WhatsAppSignupCallback? = nil + ) + { + self.setupFinalization = setupFinalization + self.signupCallback = signupCallback + } +} + +extension SocialMessagingClientTypes { + + public enum RegistrationStatus: Swift.Sendable, Swift.Equatable, Swift.RawRepresentable, Swift.CaseIterable, Swift.Hashable { + case complete + case incomplete + case sdkUnknown(Swift.String) + + public static var allCases: [RegistrationStatus] { + return [ + .complete, + .incomplete + ] + } + + public init?(rawValue: Swift.String) { + let value = Self.allCases.first(where: { $0.rawValue == rawValue }) + self = value ?? Self.sdkUnknown(rawValue) + } + + public var rawValue: Swift.String { + switch self { + case .complete: return "COMPLETE" + case .incomplete: return "INCOMPLETE" + case let .sdkUnknown(s): return s + } + } + } +} + +extension SocialMessagingClientTypes { + + /// The details of your WhatsApp phone number. + public struct WhatsAppPhoneNumberDetail: Swift.Sendable { + /// The ARN of the WhatsApp phone number. + /// This member is required. + public var arn: Swift.String? + /// The phone number that appears in the recipients display. + /// This member is required. + public var displayPhoneNumber: Swift.String? + /// The display name for this phone number. + /// This member is required. + public var displayPhoneNumberName: Swift.String? + /// The phone number ID from Meta. + /// This member is required. + public var metaPhoneNumberId: Swift.String? + /// The phone number for sending WhatsApp. + /// This member is required. + public var phoneNumber: Swift.String? + /// The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. + /// This member is required. + public var phoneNumberId: Swift.String? + /// The quality rating of the phone number. + /// This member is required. + public var qualityRating: Swift.String? + + public init( + arn: Swift.String? = nil, + displayPhoneNumber: Swift.String? = nil, + displayPhoneNumberName: Swift.String? = nil, + metaPhoneNumberId: Swift.String? = nil, + phoneNumber: Swift.String? = nil, + phoneNumberId: Swift.String? = nil, + qualityRating: Swift.String? = nil + ) + { + self.arn = arn + self.displayPhoneNumber = displayPhoneNumber + self.displayPhoneNumberName = displayPhoneNumberName + self.metaPhoneNumberId = metaPhoneNumberId + self.phoneNumber = phoneNumber + self.phoneNumberId = phoneNumberId + self.qualityRating = qualityRating + } + } +} + +extension SocialMessagingClientTypes { + + /// Contains your WhatsApp registration status and details of any unregistered WhatsApp phone number. + public struct LinkedWhatsAppBusinessAccountIdMetaData: Swift.Sendable { + /// The name of your account. + public var accountName: Swift.String? + /// The registration status of the linked WhatsApp Business Account. + public var registrationStatus: SocialMessagingClientTypes.RegistrationStatus? + /// The details for unregistered WhatsApp phone numbers. + public var unregisteredWhatsAppPhoneNumbers: [SocialMessagingClientTypes.WhatsAppPhoneNumberDetail]? + + public init( + accountName: Swift.String? = nil, + registrationStatus: SocialMessagingClientTypes.RegistrationStatus? = nil, + unregisteredWhatsAppPhoneNumbers: [SocialMessagingClientTypes.WhatsAppPhoneNumberDetail]? = nil + ) + { + self.accountName = accountName + self.registrationStatus = registrationStatus + self.unregisteredWhatsAppPhoneNumbers = unregisteredWhatsAppPhoneNumbers + } + } +} + +extension SocialMessagingClientTypes { + + /// Contains the results of WhatsAppSignupCallback. + public struct WhatsAppSignupCallbackResult: Swift.Sendable { + /// An Amazon Web Services access token generated by WhatsAppSignupCallback and used by WhatsAppSetupFinalization. + public var associateInProgressToken: Swift.String? + /// A LinkedWhatsAppBusinessAccountIdMetaData object map containing the details of any WhatsAppBusiness accounts that have incomplete setup. + public var linkedAccountsWithIncompleteSetup: [Swift.String: SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountIdMetaData]? + + public init( + associateInProgressToken: Swift.String? = nil, + linkedAccountsWithIncompleteSetup: [Swift.String: SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountIdMetaData]? = nil + ) + { + self.associateInProgressToken = associateInProgressToken + self.linkedAccountsWithIncompleteSetup = linkedAccountsWithIncompleteSetup + } + } +} + +extension SocialMessagingClientTypes.WhatsAppSignupCallbackResult: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "WhatsAppSignupCallbackResult(linkedAccountsWithIncompleteSetup: \(Swift.String(describing: linkedAccountsWithIncompleteSetup)), associateInProgressToken: \"CONTENT_REDACTED\")"} +} + +public struct AssociateWhatsAppBusinessAccountOutput: Swift.Sendable { + /// Contains your WhatsApp registration status. + public var signupCallbackResult: SocialMessagingClientTypes.WhatsAppSignupCallbackResult? + /// The status code for the response. + public var statusCode: Swift.Int? + + public init( + signupCallbackResult: SocialMessagingClientTypes.WhatsAppSignupCallbackResult? = nil, + statusCode: Swift.Int? = nil + ) + { + self.signupCallbackResult = signupCallbackResult + self.statusCode = statusCode + } +} + +/// The request processing has failed because of an unknown error, exception, or failure. +public struct InternalServiceException: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { + + public struct Properties { + public internal(set) var message: Swift.String? = nil + } + + public internal(set) var properties = Properties() + public static var typeName: Swift.String { "InternalServiceException" } + public static var fault: ClientRuntime.ErrorFault { .server } + public static var isRetryable: Swift.Bool { true } + public static var isThrottling: Swift.Bool { false } + public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() + public internal(set) var message: Swift.String? + public internal(set) var requestID: Swift.String? + + public init( + message: Swift.String? = nil + ) + { + self.properties.message = message + } +} + +/// The resource was not found. +public struct ResourceNotFoundException: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { + + public struct Properties { + public internal(set) var message: Swift.String? = nil + } + + public internal(set) var properties = Properties() + public static var typeName: Swift.String { "ResourceNotFoundException" } + public static var fault: ClientRuntime.ErrorFault { .client } + public static var isRetryable: Swift.Bool { false } + public static var isThrottling: Swift.Bool { false } + public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() + public internal(set) var message: Swift.String? + public internal(set) var requestID: Swift.String? + + public init( + message: Swift.String? = nil + ) + { + self.properties.message = message + } +} + +public struct DeleteWhatsAppMessageMediaInput: Swift.Sendable { + /// The unique identifier of the media file to delete. Use the mediaId returned from [PostWhatsAppMessageMedia](https://console.aws.amazon.com/social-messaging/latest/APIReference/API_PostWhatsAppMessageMedia.html). + /// This member is required. + public var mediaId: Swift.String? + /// The unique identifier of the originating phone number associated with the media. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use [GetLinkedWhatsAppBusinessAccount](https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_GetLinkedWhatsAppBusinessAccountPhoneNumber.html) to find a phone number's id. + /// This member is required. + public var originationPhoneNumberId: Swift.String? + + public init( + mediaId: Swift.String? = nil, + originationPhoneNumberId: Swift.String? = nil + ) + { + self.mediaId = mediaId + self.originationPhoneNumberId = originationPhoneNumberId + } +} + +public struct DeleteWhatsAppMessageMediaOutput: Swift.Sendable { + /// Success indicator for deleting the media file. + public var success: Swift.Bool? + + public init( + success: Swift.Bool? = nil + ) + { + self.success = success + } +} + +public struct DisassociateWhatsAppBusinessAccountInput: Swift.Sendable { + /// The unique identifier of your WhatsApp Business Account. WABA identifiers are formatted as waba-01234567890123456789012345678901. Use [ListLinkedWhatsAppBusinessAccounts](https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_ListLinkedWhatsAppBusinessAccounts.html) to list all WABAs and their details. + /// This member is required. + public var id: Swift.String? + + public init( + id: Swift.String? = nil + ) + { + self.id = id + } +} + +public struct DisassociateWhatsAppBusinessAccountOutput: Swift.Sendable { + + public init() { } +} + +public struct GetLinkedWhatsAppBusinessAccountInput: Swift.Sendable { + /// The unique identifier, from Amazon Web Services, of the linked WhatsApp Business Account. WABA identifiers are formatted as waba-01234567890123456789012345678901. Use [ListLinkedWhatsAppBusinessAccounts](https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_ListLinkedWhatsAppBusinessAccounts.html) to list all WABAs and their details. + /// This member is required. + public var id: Swift.String? + + public init( + id: Swift.String? = nil + ) + { + self.id = id + } +} + +extension SocialMessagingClientTypes { + + /// The details of a linked phone number. + public struct WhatsAppPhoneNumberSummary: Swift.Sendable { + /// The full Amazon Resource Name (ARN) for the phone number. + /// This member is required. + public var arn: Swift.String? + /// The phone number that appears in the recipients display. + /// This member is required. + public var displayPhoneNumber: Swift.String? + /// The display name for this phone number. + /// This member is required. + public var displayPhoneNumberName: Swift.String? + /// The phone number ID from Meta. + /// This member is required. + public var metaPhoneNumberId: Swift.String? + /// The phone number associated with the Linked WhatsApp Business Account. + /// This member is required. + public var phoneNumber: Swift.String? + /// The phone number ID. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. + /// This member is required. + public var phoneNumberId: Swift.String? + /// The quality rating of the phone number. This is from Meta. + /// This member is required. + public var qualityRating: Swift.String? + + public init( + arn: Swift.String? = nil, + displayPhoneNumber: Swift.String? = nil, + displayPhoneNumberName: Swift.String? = nil, + metaPhoneNumberId: Swift.String? = nil, + phoneNumber: Swift.String? = nil, + phoneNumberId: Swift.String? = nil, + qualityRating: Swift.String? = nil + ) + { + self.arn = arn + self.displayPhoneNumber = displayPhoneNumber + self.displayPhoneNumberName = displayPhoneNumberName + self.metaPhoneNumberId = metaPhoneNumberId + self.phoneNumber = phoneNumber + self.phoneNumberId = phoneNumberId + self.qualityRating = qualityRating + } + } +} + +extension SocialMessagingClientTypes { + + /// The details of your linked WhatsApp Business Account. + public struct LinkedWhatsAppBusinessAccount: Swift.Sendable { + /// The ARN of the linked WhatsApp Business Account. + /// This member is required. + public var arn: Swift.String? + /// The event destinations for the linked WhatsApp Business Account. + /// This member is required. + public var eventDestinations: [SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination]? + /// The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901. + /// This member is required. + public var id: Swift.String? + /// The date the WhatsApp Business Account was linked. + /// This member is required. + public var linkDate: Foundation.Date? + /// The phone numbers associated with the Linked WhatsApp Business Account. + /// This member is required. + public var phoneNumbers: [SocialMessagingClientTypes.WhatsAppPhoneNumberSummary]? + /// The registration status of the linked WhatsApp Business Account. + /// This member is required. + public var registrationStatus: SocialMessagingClientTypes.RegistrationStatus? + /// The WhatsApp Business Account ID from meta. + /// This member is required. + public var wabaId: Swift.String? + /// The name of the linked WhatsApp Business Account. + /// This member is required. + public var wabaName: Swift.String? + + public init( + arn: Swift.String? = nil, + eventDestinations: [SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination]? = nil, + id: Swift.String? = nil, + linkDate: Foundation.Date? = nil, + phoneNumbers: [SocialMessagingClientTypes.WhatsAppPhoneNumberSummary]? = nil, + registrationStatus: SocialMessagingClientTypes.RegistrationStatus? = nil, + wabaId: Swift.String? = nil, + wabaName: Swift.String? = nil + ) + { + self.arn = arn + self.eventDestinations = eventDestinations + self.id = id + self.linkDate = linkDate + self.phoneNumbers = phoneNumbers + self.registrationStatus = registrationStatus + self.wabaId = wabaId + self.wabaName = wabaName + } + } +} + +public struct GetLinkedWhatsAppBusinessAccountOutput: Swift.Sendable { + /// The details of the linked WhatsApp Business Account. + public var account: SocialMessagingClientTypes.LinkedWhatsAppBusinessAccount? + + public init( + account: SocialMessagingClientTypes.LinkedWhatsAppBusinessAccount? = nil + ) + { + self.account = account + } +} + +public struct GetLinkedWhatsAppBusinessAccountPhoneNumberInput: Swift.Sendable { + /// The unique identifier of the phone number. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use [GetLinkedWhatsAppBusinessAccount](https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_GetLinkedWhatsAppBusinessAccountPhoneNumber.html) to find a phone number's id. + /// This member is required. + public var id: Swift.String? + + public init( + id: Swift.String? = nil + ) + { + self.id = id + } +} + +public struct GetLinkedWhatsAppBusinessAccountPhoneNumberOutput: Swift.Sendable { + /// The WABA identifier linked to the phone number, formatted as waba-01234567890123456789012345678901. + public var linkedWhatsAppBusinessAccountId: Swift.String? + /// The details of your WhatsApp phone number. + public var phoneNumber: SocialMessagingClientTypes.WhatsAppPhoneNumberDetail? + + public init( + linkedWhatsAppBusinessAccountId: Swift.String? = nil, + phoneNumber: SocialMessagingClientTypes.WhatsAppPhoneNumberDetail? = nil + ) + { + self.linkedWhatsAppBusinessAccountId = linkedWhatsAppBusinessAccountId + self.phoneNumber = phoneNumber + } +} + +extension SocialMessagingClientTypes { + + /// Contains information for the S3 bucket that contains media files. + public struct S3File: Swift.Sendable { + /// The bucket name. + /// This member is required. + public var bucketName: Swift.String? + /// The object key of the media file. + /// This member is required. + public var key: Swift.String? + + public init( + bucketName: Swift.String? = nil, + key: Swift.String? = nil + ) + { + self.bucketName = bucketName + self.key = key + } + } +} + +extension SocialMessagingClientTypes.S3File: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "CONTENT_REDACTED" + } +} + +extension SocialMessagingClientTypes { + + /// You can use presigned URLs to grant time-limited access to objects in Amazon S3 without updating your bucket policy. For more information, see [Working with presigned URLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html) in the Amazon S3 User Guide. + public struct S3PresignedUrl: Swift.Sendable { + /// A map of headers and their values. You must specify the Content-Type header when using PostWhatsAppMessageMedia. For a list of common headers, see [Common Request Headers](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html) in the Amazon S3 API Reference + /// This member is required. + public var headers: [Swift.String: Swift.String]? + /// The presign url to the object. + /// This member is required. + public var url: Swift.String? + + public init( + headers: [Swift.String: Swift.String]? = nil, + url: Swift.String? = nil + ) + { + self.headers = headers + self.url = url + } + } +} + +extension SocialMessagingClientTypes.S3PresignedUrl: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "CONTENT_REDACTED" + } +} + +public struct GetWhatsAppMessageMediaInput: Swift.Sendable { + /// The bucketName and key of the S3 media file. + public var destinationS3File: SocialMessagingClientTypes.S3File? + /// The presign url of the media file. + public var destinationS3PresignedUrl: SocialMessagingClientTypes.S3PresignedUrl? + /// The unique identifier for the media file. + /// This member is required. + public var mediaId: Swift.String? + /// Set to True to get only the metadata for the file. + public var metadataOnly: Swift.Bool? + /// The unique identifier of the originating phone number for the WhatsApp message media. The phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use [GetLinkedWhatsAppBusinessAccount](https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_GetLinkedWhatsAppBusinessAccountPhoneNumber.html) to find a phone number's id. + /// This member is required. + public var originationPhoneNumberId: Swift.String? + + public init( + destinationS3File: SocialMessagingClientTypes.S3File? = nil, + destinationS3PresignedUrl: SocialMessagingClientTypes.S3PresignedUrl? = nil, + mediaId: Swift.String? = nil, + metadataOnly: Swift.Bool? = nil, + originationPhoneNumberId: Swift.String? = nil + ) + { + self.destinationS3File = destinationS3File + self.destinationS3PresignedUrl = destinationS3PresignedUrl + self.mediaId = mediaId + self.metadataOnly = metadataOnly + self.originationPhoneNumberId = originationPhoneNumberId + } +} + +extension GetWhatsAppMessageMediaInput: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "GetWhatsAppMessageMediaInput(mediaId: \(Swift.String(describing: mediaId)), metadataOnly: \(Swift.String(describing: metadataOnly)), originationPhoneNumberId: \(Swift.String(describing: originationPhoneNumberId)), destinationS3File: \"CONTENT_REDACTED\", destinationS3PresignedUrl: \"CONTENT_REDACTED\")"} +} + +public struct GetWhatsAppMessageMediaOutput: Swift.Sendable { + /// The file size of the media, in KB. + public var fileSize: Swift.Int? + /// The MIME type of the media. + public var mimeType: Swift.String? + + public init( + fileSize: Swift.Int? = nil, + mimeType: Swift.String? = nil + ) + { + self.fileSize = fileSize + self.mimeType = mimeType + } +} + +public struct ListLinkedWhatsAppBusinessAccountsInput: Swift.Sendable { + /// The maximum number of results to return. + public var maxResults: Swift.Int? + /// The next token for pagination. + public var nextToken: Swift.String? + + public init( + maxResults: Swift.Int? = nil, + nextToken: Swift.String? = nil + ) + { + self.maxResults = maxResults + self.nextToken = nextToken + } +} + +extension SocialMessagingClientTypes { + + /// The details of a linked WhatsApp Business Account. + public struct LinkedWhatsAppBusinessAccountSummary: Swift.Sendable { + /// The ARN of the linked WhatsApp Business Account. + /// This member is required. + public var arn: Swift.String? + /// The event destinations for the linked WhatsApp Business Account. + /// This member is required. + public var eventDestinations: [SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination]? + /// The ID of the linked WhatsApp Business Account, formatted as waba-01234567890123456789012345678901. + /// This member is required. + public var id: Swift.String? + /// The date the WhatsApp Business Account was linked. + /// This member is required. + public var linkDate: Foundation.Date? + /// The registration status of the linked WhatsApp Business Account. + /// This member is required. + public var registrationStatus: SocialMessagingClientTypes.RegistrationStatus? + /// The WhatsApp Business Account ID provided by Meta. + /// This member is required. + public var wabaId: Swift.String? + /// The name of the linked WhatsApp Business Account. + /// This member is required. + public var wabaName: Swift.String? + + public init( + arn: Swift.String? = nil, + eventDestinations: [SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination]? = nil, + id: Swift.String? = nil, + linkDate: Foundation.Date? = nil, + registrationStatus: SocialMessagingClientTypes.RegistrationStatus? = nil, + wabaId: Swift.String? = nil, + wabaName: Swift.String? = nil + ) + { + self.arn = arn + self.eventDestinations = eventDestinations + self.id = id + self.linkDate = linkDate + self.registrationStatus = registrationStatus + self.wabaId = wabaId + self.wabaName = wabaName + } + } +} + +public struct ListLinkedWhatsAppBusinessAccountsOutput: Swift.Sendable { + /// A list of WhatsApp Business Accounts linked to your Amazon Web Services account. + public var linkedAccounts: [SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountSummary]? + /// The next token for pagination. + public var nextToken: Swift.String? + + public init( + linkedAccounts: [SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountSummary]? = nil, + nextToken: Swift.String? = nil + ) + { + self.linkedAccounts = linkedAccounts + self.nextToken = nextToken + } +} + +public struct PutWhatsAppBusinessAccountEventDestinationsInput: Swift.Sendable { + /// An array of WhatsAppBusinessAccountEventDestination event destinations. + /// This member is required. + public var eventDestinations: [SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination]? + /// The unique identifier of your WhatsApp Business Account. WABA identifiers are formatted as waba-01234567890123456789012345678901. Use [ListLinkedWhatsAppBusinessAccounts](https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_ListLinkedWhatsAppBusinessAccounts.html) to list all WABAs and their details. + /// This member is required. + public var id: Swift.String? + + public init( + eventDestinations: [SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination]? = nil, + id: Swift.String? = nil + ) + { + self.eventDestinations = eventDestinations + self.id = id + } +} + +public struct PutWhatsAppBusinessAccountEventDestinationsOutput: Swift.Sendable { + + public init() { } +} + +public struct PostWhatsAppMessageMediaInput: Swift.Sendable { + /// The ID of the phone number to associate with the WhatsApp media file. The phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use [GetLinkedWhatsAppBusinessAccount](https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_GetLinkedWhatsAppBusinessAccountPhoneNumber.html) to find a phone number's id. + /// This member is required. + public var originationPhoneNumberId: Swift.String? + /// The source S3 url for the media file. + public var sourceS3File: SocialMessagingClientTypes.S3File? + /// The source presign url of the media file. + public var sourceS3PresignedUrl: SocialMessagingClientTypes.S3PresignedUrl? + + public init( + originationPhoneNumberId: Swift.String? = nil, + sourceS3File: SocialMessagingClientTypes.S3File? = nil, + sourceS3PresignedUrl: SocialMessagingClientTypes.S3PresignedUrl? = nil + ) + { + self.originationPhoneNumberId = originationPhoneNumberId + self.sourceS3File = sourceS3File + self.sourceS3PresignedUrl = sourceS3PresignedUrl + } +} + +extension PostWhatsAppMessageMediaInput: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "PostWhatsAppMessageMediaInput(originationPhoneNumberId: \(Swift.String(describing: originationPhoneNumberId)), sourceS3File: \"CONTENT_REDACTED\", sourceS3PresignedUrl: \"CONTENT_REDACTED\")"} +} + +public struct PostWhatsAppMessageMediaOutput: Swift.Sendable { + /// The unique identifier of the posted WhatsApp message. + public var mediaId: Swift.String? + + public init( + mediaId: Swift.String? = nil + ) + { + self.mediaId = mediaId + } +} + +public struct SendWhatsAppMessageInput: Swift.Sendable { + /// The message to send through WhatsApp. The length is in KB. The message field passes through a WhatsApp Message object, see [Messages](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages) in the WhatsApp Business Platform Cloud API Reference. + /// This member is required. + public var message: Foundation.Data? + /// The API version for the request formatted as v{VersionNumber}. For a list of supported API versions and Amazon Web Services Regions, see [ Amazon Web Services End User Messaging Social API Service Endpoints](https://docs.aws.amazon.com/general/latest/gr/end-user-messaging.html) in the Amazon Web Services General Reference. + /// This member is required. + public var metaApiVersion: Swift.String? + /// The ID of the phone number used to send the WhatsApp message. If you are sending a media file only the originationPhoneNumberId used to upload the file can be used. Phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901. Use [GetLinkedWhatsAppBusinessAccount](https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_GetLinkedWhatsAppBusinessAccountPhoneNumber.html) to find a phone number's id. + /// This member is required. + public var originationPhoneNumberId: Swift.String? + + public init( + message: Foundation.Data? = nil, + metaApiVersion: Swift.String? = nil, + originationPhoneNumberId: Swift.String? = nil + ) + { + self.message = message + self.metaApiVersion = metaApiVersion + self.originationPhoneNumberId = originationPhoneNumberId + } +} + +extension SendWhatsAppMessageInput: Swift.CustomDebugStringConvertible { + public var debugDescription: Swift.String { + "SendWhatsAppMessageInput(metaApiVersion: \(Swift.String(describing: metaApiVersion)), originationPhoneNumberId: \(Swift.String(describing: originationPhoneNumberId)), message: \"CONTENT_REDACTED\")"} +} + +public struct SendWhatsAppMessageOutput: Swift.Sendable { + /// The unique identifier of the message. + public var messageId: Swift.String? + + public init( + messageId: Swift.String? = nil + ) + { + self.messageId = messageId + } +} + +public struct ListTagsForResourceInput: Swift.Sendable { + /// The Amazon Resource Name (ARN) of the resource to retrieve the tags from. + /// This member is required. + public var resourceArn: Swift.String? + + public init( + resourceArn: Swift.String? = nil + ) + { + self.resourceArn = resourceArn + } +} + +public struct ListTagsForResourceOutput: Swift.Sendable { + /// The status code of the response. + public var statusCode: Swift.Int? + /// The tags for the resource. + public var tags: [SocialMessagingClientTypes.Tag]? + + public init( + statusCode: Swift.Int? = nil, + tags: [SocialMessagingClientTypes.Tag]? = nil + ) + { + self.statusCode = statusCode + self.tags = tags + } +} + +public struct TagResourceInput: Swift.Sendable { + /// The Amazon Resource Name (ARN) of the resource to tag. + /// This member is required. + public var resourceArn: Swift.String? + /// The tags to add to the resource. + /// This member is required. + public var tags: [SocialMessagingClientTypes.Tag]? + + public init( + resourceArn: Swift.String? = nil, + tags: [SocialMessagingClientTypes.Tag]? = nil + ) + { + self.resourceArn = resourceArn + self.tags = tags + } +} + +public struct TagResourceOutput: Swift.Sendable { + /// The status code of the tag resource operation. + public var statusCode: Swift.Int? + + public init( + statusCode: Swift.Int? = nil + ) + { + self.statusCode = statusCode + } +} + +public struct UntagResourceInput: Swift.Sendable { + /// The Amazon Resource Name (ARN) of the resource to remove tags from. + /// This member is required. + public var resourceArn: Swift.String? + /// The keys of the tags to remove from the resource. + /// This member is required. + public var tagKeys: [Swift.String]? + + public init( + resourceArn: Swift.String? = nil, + tagKeys: [Swift.String]? = nil + ) + { + self.resourceArn = resourceArn + self.tagKeys = tagKeys + } +} + +public struct UntagResourceOutput: Swift.Sendable { + /// The status code of the untag resource operation. + public var statusCode: Swift.Int? + + public init( + statusCode: Swift.Int? = nil + ) + { + self.statusCode = statusCode + } +} + +/// The request contains an invalid parameter value. +public struct ValidationException: ClientRuntime.ModeledError, AWSClientRuntime.AWSServiceError, ClientRuntime.HTTPError, Swift.Error { + + public struct Properties { + public internal(set) var message: Swift.String? = nil + } + + public internal(set) var properties = Properties() + public static var typeName: Swift.String { "ValidationException" } + public static var fault: ClientRuntime.ErrorFault { .client } + public static var isRetryable: Swift.Bool { false } + public static var isThrottling: Swift.Bool { false } + public internal(set) var httpResponse = SmithyHTTPAPI.HTTPResponse() + public internal(set) var message: Swift.String? + public internal(set) var requestID: Swift.String? + + public init( + message: Swift.String? = nil + ) + { + self.properties.message = message + } +} + +extension AssociateWhatsAppBusinessAccountInput { + + static func urlPathProvider(_ value: AssociateWhatsAppBusinessAccountInput) -> Swift.String? { + return "/v1/whatsapp/signup" + } +} + +extension DeleteWhatsAppMessageMediaInput { + + static func urlPathProvider(_ value: DeleteWhatsAppMessageMediaInput) -> Swift.String? { + return "/v1/whatsapp/media" + } +} + +extension DeleteWhatsAppMessageMediaInput { + + static func queryItemProvider(_ value: DeleteWhatsAppMessageMediaInput) throws -> [Smithy.URIQueryItem] { + var items = [Smithy.URIQueryItem]() + guard let originationPhoneNumberId = value.originationPhoneNumberId else { + let message = "Creating a URL Query Item failed. originationPhoneNumberId is required and must not be nil." + throw Smithy.ClientError.unknownError(message) + } + let originationPhoneNumberIdQueryItem = Smithy.URIQueryItem(name: "originationPhoneNumberId".urlPercentEncoding(), value: Swift.String(originationPhoneNumberId).urlPercentEncoding()) + items.append(originationPhoneNumberIdQueryItem) + guard let mediaId = value.mediaId else { + let message = "Creating a URL Query Item failed. mediaId is required and must not be nil." + throw Smithy.ClientError.unknownError(message) + } + let mediaIdQueryItem = Smithy.URIQueryItem(name: "mediaId".urlPercentEncoding(), value: Swift.String(mediaId).urlPercentEncoding()) + items.append(mediaIdQueryItem) + return items + } +} + +extension DisassociateWhatsAppBusinessAccountInput { + + static func urlPathProvider(_ value: DisassociateWhatsAppBusinessAccountInput) -> Swift.String? { + return "/v1/whatsapp/waba/disassociate" + } +} + +extension DisassociateWhatsAppBusinessAccountInput { + + static func queryItemProvider(_ value: DisassociateWhatsAppBusinessAccountInput) throws -> [Smithy.URIQueryItem] { + var items = [Smithy.URIQueryItem]() + guard let id = value.id else { + let message = "Creating a URL Query Item failed. id is required and must not be nil." + throw Smithy.ClientError.unknownError(message) + } + let idQueryItem = Smithy.URIQueryItem(name: "id".urlPercentEncoding(), value: Swift.String(id).urlPercentEncoding()) + items.append(idQueryItem) + return items + } +} + +extension GetLinkedWhatsAppBusinessAccountInput { + + static func urlPathProvider(_ value: GetLinkedWhatsAppBusinessAccountInput) -> Swift.String? { + return "/v1/whatsapp/waba/details" + } +} + +extension GetLinkedWhatsAppBusinessAccountInput { + + static func queryItemProvider(_ value: GetLinkedWhatsAppBusinessAccountInput) throws -> [Smithy.URIQueryItem] { + var items = [Smithy.URIQueryItem]() + guard let id = value.id else { + let message = "Creating a URL Query Item failed. id is required and must not be nil." + throw Smithy.ClientError.unknownError(message) + } + let idQueryItem = Smithy.URIQueryItem(name: "id".urlPercentEncoding(), value: Swift.String(id).urlPercentEncoding()) + items.append(idQueryItem) + return items + } +} + +extension GetLinkedWhatsAppBusinessAccountPhoneNumberInput { + + static func urlPathProvider(_ value: GetLinkedWhatsAppBusinessAccountPhoneNumberInput) -> Swift.String? { + return "/v1/whatsapp/waba/phone/details" + } +} + +extension GetLinkedWhatsAppBusinessAccountPhoneNumberInput { + + static func queryItemProvider(_ value: GetLinkedWhatsAppBusinessAccountPhoneNumberInput) throws -> [Smithy.URIQueryItem] { + var items = [Smithy.URIQueryItem]() + guard let id = value.id else { + let message = "Creating a URL Query Item failed. id is required and must not be nil." + throw Smithy.ClientError.unknownError(message) + } + let idQueryItem = Smithy.URIQueryItem(name: "id".urlPercentEncoding(), value: Swift.String(id).urlPercentEncoding()) + items.append(idQueryItem) + return items + } +} + +extension GetWhatsAppMessageMediaInput { + + static func urlPathProvider(_ value: GetWhatsAppMessageMediaInput) -> Swift.String? { + return "/v1/whatsapp/media/get" + } +} + +extension ListLinkedWhatsAppBusinessAccountsInput { + + static func urlPathProvider(_ value: ListLinkedWhatsAppBusinessAccountsInput) -> Swift.String? { + return "/v1/whatsapp/waba/list" + } +} + +extension ListLinkedWhatsAppBusinessAccountsInput { + + static func queryItemProvider(_ value: ListLinkedWhatsAppBusinessAccountsInput) throws -> [Smithy.URIQueryItem] { + var items = [Smithy.URIQueryItem]() + if let nextToken = value.nextToken { + let nextTokenQueryItem = Smithy.URIQueryItem(name: "nextToken".urlPercentEncoding(), value: Swift.String(nextToken).urlPercentEncoding()) + items.append(nextTokenQueryItem) + } + if let maxResults = value.maxResults { + let maxResultsQueryItem = Smithy.URIQueryItem(name: "maxResults".urlPercentEncoding(), value: Swift.String(maxResults).urlPercentEncoding()) + items.append(maxResultsQueryItem) + } + return items + } +} + +extension ListTagsForResourceInput { + + static func urlPathProvider(_ value: ListTagsForResourceInput) -> Swift.String? { + return "/v1/tags/list" + } +} + +extension ListTagsForResourceInput { + + static func queryItemProvider(_ value: ListTagsForResourceInput) throws -> [Smithy.URIQueryItem] { + var items = [Smithy.URIQueryItem]() + guard let resourceArn = value.resourceArn else { + let message = "Creating a URL Query Item failed. resourceArn is required and must not be nil." + throw Smithy.ClientError.unknownError(message) + } + let resourceArnQueryItem = Smithy.URIQueryItem(name: "resourceArn".urlPercentEncoding(), value: Swift.String(resourceArn).urlPercentEncoding()) + items.append(resourceArnQueryItem) + return items + } +} + +extension PostWhatsAppMessageMediaInput { + + static func urlPathProvider(_ value: PostWhatsAppMessageMediaInput) -> Swift.String? { + return "/v1/whatsapp/media" + } +} + +extension PutWhatsAppBusinessAccountEventDestinationsInput { + + static func urlPathProvider(_ value: PutWhatsAppBusinessAccountEventDestinationsInput) -> Swift.String? { + return "/v1/whatsapp/waba/eventdestinations" + } +} + +extension SendWhatsAppMessageInput { + + static func urlPathProvider(_ value: SendWhatsAppMessageInput) -> Swift.String? { + return "/v1/whatsapp/send" + } +} + +extension TagResourceInput { + + static func urlPathProvider(_ value: TagResourceInput) -> Swift.String? { + return "/v1/tags/tag-resource" + } +} + +extension UntagResourceInput { + + static func urlPathProvider(_ value: UntagResourceInput) -> Swift.String? { + return "/v1/tags/untag-resource" + } +} + +extension AssociateWhatsAppBusinessAccountInput { + + static func write(value: AssociateWhatsAppBusinessAccountInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["setupFinalization"].write(value.setupFinalization, with: SocialMessagingClientTypes.WhatsAppSetupFinalization.write(value:to:)) + try writer["signupCallback"].write(value.signupCallback, with: SocialMessagingClientTypes.WhatsAppSignupCallback.write(value:to:)) + } +} + +extension GetWhatsAppMessageMediaInput { + + static func write(value: GetWhatsAppMessageMediaInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["destinationS3File"].write(value.destinationS3File, with: SocialMessagingClientTypes.S3File.write(value:to:)) + try writer["destinationS3PresignedUrl"].write(value.destinationS3PresignedUrl, with: SocialMessagingClientTypes.S3PresignedUrl.write(value:to:)) + try writer["mediaId"].write(value.mediaId) + try writer["metadataOnly"].write(value.metadataOnly) + try writer["originationPhoneNumberId"].write(value.originationPhoneNumberId) + } +} + +extension PostWhatsAppMessageMediaInput { + + static func write(value: PostWhatsAppMessageMediaInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["originationPhoneNumberId"].write(value.originationPhoneNumberId) + try writer["sourceS3File"].write(value.sourceS3File, with: SocialMessagingClientTypes.S3File.write(value:to:)) + try writer["sourceS3PresignedUrl"].write(value.sourceS3PresignedUrl, with: SocialMessagingClientTypes.S3PresignedUrl.write(value:to:)) + } +} + +extension PutWhatsAppBusinessAccountEventDestinationsInput { + + static func write(value: PutWhatsAppBusinessAccountEventDestinationsInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["eventDestinations"].writeList(value.eventDestinations, memberWritingClosure: SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination.write(value:to:), memberNodeInfo: "member", isFlattened: false) + try writer["id"].write(value.id) + } +} + +extension SendWhatsAppMessageInput { + + static func write(value: SendWhatsAppMessageInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["message"].write(value.message) + try writer["metaApiVersion"].write(value.metaApiVersion) + try writer["originationPhoneNumberId"].write(value.originationPhoneNumberId) + } +} + +extension TagResourceInput { + + static func write(value: TagResourceInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["resourceArn"].write(value.resourceArn) + try writer["tags"].writeList(value.tags, memberWritingClosure: SocialMessagingClientTypes.Tag.write(value:to:), memberNodeInfo: "member", isFlattened: false) + } +} + +extension UntagResourceInput { + + static func write(value: UntagResourceInput?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["resourceArn"].write(value.resourceArn) + try writer["tagKeys"].writeList(value.tagKeys, memberWritingClosure: SmithyReadWrite.WritingClosures.writeString(value:to:), memberNodeInfo: "member", isFlattened: false) + } +} + +extension AssociateWhatsAppBusinessAccountOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> AssociateWhatsAppBusinessAccountOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = AssociateWhatsAppBusinessAccountOutput() + value.signupCallbackResult = try reader["signupCallbackResult"].readIfPresent(with: SocialMessagingClientTypes.WhatsAppSignupCallbackResult.read(from:)) + value.statusCode = try reader["statusCode"].readIfPresent() + return value + } +} + +extension DeleteWhatsAppMessageMediaOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> DeleteWhatsAppMessageMediaOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = DeleteWhatsAppMessageMediaOutput() + value.success = try reader["success"].readIfPresent() + return value + } +} + +extension DisassociateWhatsAppBusinessAccountOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> DisassociateWhatsAppBusinessAccountOutput { + return DisassociateWhatsAppBusinessAccountOutput() + } +} + +extension GetLinkedWhatsAppBusinessAccountOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> GetLinkedWhatsAppBusinessAccountOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = GetLinkedWhatsAppBusinessAccountOutput() + value.account = try reader["account"].readIfPresent(with: SocialMessagingClientTypes.LinkedWhatsAppBusinessAccount.read(from:)) + return value + } +} + +extension GetLinkedWhatsAppBusinessAccountPhoneNumberOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> GetLinkedWhatsAppBusinessAccountPhoneNumberOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = GetLinkedWhatsAppBusinessAccountPhoneNumberOutput() + value.linkedWhatsAppBusinessAccountId = try reader["linkedWhatsAppBusinessAccountId"].readIfPresent() + value.phoneNumber = try reader["phoneNumber"].readIfPresent(with: SocialMessagingClientTypes.WhatsAppPhoneNumberDetail.read(from:)) + return value + } +} + +extension GetWhatsAppMessageMediaOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> GetWhatsAppMessageMediaOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = GetWhatsAppMessageMediaOutput() + value.fileSize = try reader["fileSize"].readIfPresent() + value.mimeType = try reader["mimeType"].readIfPresent() + return value + } +} + +extension ListLinkedWhatsAppBusinessAccountsOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> ListLinkedWhatsAppBusinessAccountsOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = ListLinkedWhatsAppBusinessAccountsOutput() + value.linkedAccounts = try reader["linkedAccounts"].readListIfPresent(memberReadingClosure: SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountSummary.read(from:), memberNodeInfo: "member", isFlattened: false) + value.nextToken = try reader["nextToken"].readIfPresent() + return value + } +} + +extension ListTagsForResourceOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> ListTagsForResourceOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = ListTagsForResourceOutput() + value.statusCode = try reader["statusCode"].readIfPresent() + value.tags = try reader["tags"].readListIfPresent(memberReadingClosure: SocialMessagingClientTypes.Tag.read(from:), memberNodeInfo: "member", isFlattened: false) + return value + } +} + +extension PostWhatsAppMessageMediaOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> PostWhatsAppMessageMediaOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = PostWhatsAppMessageMediaOutput() + value.mediaId = try reader["mediaId"].readIfPresent() + return value + } +} + +extension PutWhatsAppBusinessAccountEventDestinationsOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> PutWhatsAppBusinessAccountEventDestinationsOutput { + return PutWhatsAppBusinessAccountEventDestinationsOutput() + } +} + +extension SendWhatsAppMessageOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> SendWhatsAppMessageOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = SendWhatsAppMessageOutput() + value.messageId = try reader["messageId"].readIfPresent() + return value + } +} + +extension TagResourceOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> TagResourceOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = TagResourceOutput() + value.statusCode = try reader["statusCode"].readIfPresent() + return value + } +} + +extension UntagResourceOutput { + + static func httpOutput(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> UntagResourceOutput { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let reader = responseReader + var value = UntagResourceOutput() + value.statusCode = try reader["statusCode"].readIfPresent() + return value + } +} + +func httpServiceError(baseError: AWSClientRuntime.RestJSONError) throws -> Swift.Error? { + switch baseError.code { + case "AccessDeniedException": return try AccessDeniedException.makeError(baseError: baseError) + case "ValidationException": return try ValidationException.makeError(baseError: baseError) + default: return nil + } +} + +enum AssociateWhatsAppBusinessAccountOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "DependencyException": return try DependencyException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum DeleteWhatsAppMessageMediaOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "AccessDeniedByMetaException": return try AccessDeniedByMetaException.makeError(baseError: baseError) + case "DependencyException": return try DependencyException.makeError(baseError: baseError) + case "InternalServiceException": return try InternalServiceException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ResourceNotFoundException": return try ResourceNotFoundException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum DisassociateWhatsAppBusinessAccountOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "DependencyException": return try DependencyException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ResourceNotFoundException": return try ResourceNotFoundException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum GetLinkedWhatsAppBusinessAccountOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "DependencyException": return try DependencyException.makeError(baseError: baseError) + case "InternalServiceException": return try InternalServiceException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ResourceNotFoundException": return try ResourceNotFoundException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum GetLinkedWhatsAppBusinessAccountPhoneNumberOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "DependencyException": return try DependencyException.makeError(baseError: baseError) + case "InternalServiceException": return try InternalServiceException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ResourceNotFoundException": return try ResourceNotFoundException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum GetWhatsAppMessageMediaOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "AccessDeniedByMetaException": return try AccessDeniedByMetaException.makeError(baseError: baseError) + case "DependencyException": return try DependencyException.makeError(baseError: baseError) + case "InternalServiceException": return try InternalServiceException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ResourceNotFoundException": return try ResourceNotFoundException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum ListLinkedWhatsAppBusinessAccountsOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "InternalServiceException": return try InternalServiceException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ResourceNotFoundException": return try ResourceNotFoundException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum ListTagsForResourceOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "InternalServiceException": return try InternalServiceException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum PostWhatsAppMessageMediaOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "AccessDeniedByMetaException": return try AccessDeniedByMetaException.makeError(baseError: baseError) + case "DependencyException": return try DependencyException.makeError(baseError: baseError) + case "InternalServiceException": return try InternalServiceException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ResourceNotFoundException": return try ResourceNotFoundException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum PutWhatsAppBusinessAccountEventDestinationsOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "InternalServiceException": return try InternalServiceException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum SendWhatsAppMessageOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "DependencyException": return try DependencyException.makeError(baseError: baseError) + case "InternalServiceException": return try InternalServiceException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ResourceNotFoundException": return try ResourceNotFoundException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum TagResourceOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "InternalServiceException": return try InternalServiceException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +enum UntagResourceOutputError { + + static func httpError(from httpResponse: SmithyHTTPAPI.HTTPResponse) async throws -> Swift.Error { + let data = try await httpResponse.data() + let responseReader = try SmithyJSON.Reader.from(data: data) + let baseError = try AWSClientRuntime.RestJSONError(httpResponse: httpResponse, responseReader: responseReader, noErrorWrapping: false) + if let error = baseError.customError() { return error } + if let error = try httpServiceError(baseError: baseError) { return error } + switch baseError.code { + case "InternalServiceException": return try InternalServiceException.makeError(baseError: baseError) + case "InvalidParametersException": return try InvalidParametersException.makeError(baseError: baseError) + case "ThrottledRequestException": return try ThrottledRequestException.makeError(baseError: baseError) + default: return try AWSClientRuntime.UnknownAWSHTTPServiceError.makeError(baseError: baseError) + } + } +} + +extension ThrottledRequestException { + + static func makeError(baseError: AWSClientRuntime.RestJSONError) throws -> ThrottledRequestException { + let reader = baseError.errorBodyReader + var value = ThrottledRequestException() + value.properties.message = try reader["message"].readIfPresent() + value.httpResponse = baseError.httpResponse + value.requestID = baseError.requestID + value.message = baseError.message + return value + } +} + +extension InvalidParametersException { + + static func makeError(baseError: AWSClientRuntime.RestJSONError) throws -> InvalidParametersException { + let reader = baseError.errorBodyReader + var value = InvalidParametersException() + value.properties.message = try reader["message"].readIfPresent() + value.httpResponse = baseError.httpResponse + value.requestID = baseError.requestID + value.message = baseError.message + return value + } +} + +extension DependencyException { + + static func makeError(baseError: AWSClientRuntime.RestJSONError) throws -> DependencyException { + let reader = baseError.errorBodyReader + var value = DependencyException() + value.properties.message = try reader["message"].readIfPresent() + value.httpResponse = baseError.httpResponse + value.requestID = baseError.requestID + value.message = baseError.message + return value + } +} + +extension ResourceNotFoundException { + + static func makeError(baseError: AWSClientRuntime.RestJSONError) throws -> ResourceNotFoundException { + let reader = baseError.errorBodyReader + var value = ResourceNotFoundException() + value.properties.message = try reader["message"].readIfPresent() + value.httpResponse = baseError.httpResponse + value.requestID = baseError.requestID + value.message = baseError.message + return value + } +} + +extension AccessDeniedByMetaException { + + static func makeError(baseError: AWSClientRuntime.RestJSONError) throws -> AccessDeniedByMetaException { + let reader = baseError.errorBodyReader + var value = AccessDeniedByMetaException() + value.properties.message = try reader["message"].readIfPresent() + value.httpResponse = baseError.httpResponse + value.requestID = baseError.requestID + value.message = baseError.message + return value + } +} + +extension InternalServiceException { + + static func makeError(baseError: AWSClientRuntime.RestJSONError) throws -> InternalServiceException { + let reader = baseError.errorBodyReader + var value = InternalServiceException() + value.properties.message = try reader["message"].readIfPresent() + value.httpResponse = baseError.httpResponse + value.requestID = baseError.requestID + value.message = baseError.message + return value + } +} + +extension AccessDeniedException { + + static func makeError(baseError: AWSClientRuntime.RestJSONError) throws -> AccessDeniedException { + let reader = baseError.errorBodyReader + var value = AccessDeniedException() + value.properties.message = try reader["message"].readIfPresent() + value.httpResponse = baseError.httpResponse + value.requestID = baseError.requestID + value.message = baseError.message + return value + } +} + +extension ValidationException { + + static func makeError(baseError: AWSClientRuntime.RestJSONError) throws -> ValidationException { + let reader = baseError.errorBodyReader + var value = ValidationException() + value.properties.message = try reader["message"].readIfPresent() + value.httpResponse = baseError.httpResponse + value.requestID = baseError.requestID + value.message = baseError.message + return value + } +} + +extension SocialMessagingClientTypes.WhatsAppSignupCallbackResult { + + static func read(from reader: SmithyJSON.Reader) throws -> SocialMessagingClientTypes.WhatsAppSignupCallbackResult { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = SocialMessagingClientTypes.WhatsAppSignupCallbackResult() + value.associateInProgressToken = try reader["associateInProgressToken"].readIfPresent() + value.linkedAccountsWithIncompleteSetup = try reader["linkedAccountsWithIncompleteSetup"].readMapIfPresent(valueReadingClosure: SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountIdMetaData.read(from:), keyNodeInfo: "key", valueNodeInfo: "value", isFlattened: false) + return value + } +} + +extension SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountIdMetaData { + + static func read(from reader: SmithyJSON.Reader) throws -> SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountIdMetaData { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountIdMetaData() + value.accountName = try reader["accountName"].readIfPresent() + value.registrationStatus = try reader["registrationStatus"].readIfPresent() + value.unregisteredWhatsAppPhoneNumbers = try reader["unregisteredWhatsAppPhoneNumbers"].readListIfPresent(memberReadingClosure: SocialMessagingClientTypes.WhatsAppPhoneNumberDetail.read(from:), memberNodeInfo: "member", isFlattened: false) + return value + } +} + +extension SocialMessagingClientTypes.WhatsAppPhoneNumberDetail { + + static func read(from reader: SmithyJSON.Reader) throws -> SocialMessagingClientTypes.WhatsAppPhoneNumberDetail { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = SocialMessagingClientTypes.WhatsAppPhoneNumberDetail() + value.arn = try reader["arn"].readIfPresent() ?? "" + value.phoneNumber = try reader["phoneNumber"].readIfPresent() ?? "" + value.phoneNumberId = try reader["phoneNumberId"].readIfPresent() ?? "" + value.metaPhoneNumberId = try reader["metaPhoneNumberId"].readIfPresent() ?? "" + value.displayPhoneNumberName = try reader["displayPhoneNumberName"].readIfPresent() ?? "" + value.displayPhoneNumber = try reader["displayPhoneNumber"].readIfPresent() ?? "" + value.qualityRating = try reader["qualityRating"].readIfPresent() ?? "" + return value + } +} + +extension SocialMessagingClientTypes.LinkedWhatsAppBusinessAccount { + + static func read(from reader: SmithyJSON.Reader) throws -> SocialMessagingClientTypes.LinkedWhatsAppBusinessAccount { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = SocialMessagingClientTypes.LinkedWhatsAppBusinessAccount() + value.arn = try reader["arn"].readIfPresent() ?? "" + value.id = try reader["id"].readIfPresent() ?? "" + value.wabaId = try reader["wabaId"].readIfPresent() ?? "" + value.registrationStatus = try reader["registrationStatus"].readIfPresent() ?? .sdkUnknown("") + value.linkDate = try reader["linkDate"].readTimestampIfPresent(format: SmithyTimestamps.TimestampFormat.epochSeconds) ?? SmithyTimestamps.TimestampFormatter(format: .dateTime).date(from: "1970-01-01T00:00:00Z") + value.wabaName = try reader["wabaName"].readIfPresent() ?? "" + value.eventDestinations = try reader["eventDestinations"].readListIfPresent(memberReadingClosure: SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination.read(from:), memberNodeInfo: "member", isFlattened: false) ?? [] + value.phoneNumbers = try reader["phoneNumbers"].readListIfPresent(memberReadingClosure: SocialMessagingClientTypes.WhatsAppPhoneNumberSummary.read(from:), memberNodeInfo: "member", isFlattened: false) ?? [] + return value + } +} + +extension SocialMessagingClientTypes.WhatsAppPhoneNumberSummary { + + static func read(from reader: SmithyJSON.Reader) throws -> SocialMessagingClientTypes.WhatsAppPhoneNumberSummary { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = SocialMessagingClientTypes.WhatsAppPhoneNumberSummary() + value.arn = try reader["arn"].readIfPresent() ?? "" + value.phoneNumber = try reader["phoneNumber"].readIfPresent() ?? "" + value.phoneNumberId = try reader["phoneNumberId"].readIfPresent() ?? "" + value.metaPhoneNumberId = try reader["metaPhoneNumberId"].readIfPresent() ?? "" + value.displayPhoneNumberName = try reader["displayPhoneNumberName"].readIfPresent() ?? "" + value.displayPhoneNumber = try reader["displayPhoneNumber"].readIfPresent() ?? "" + value.qualityRating = try reader["qualityRating"].readIfPresent() ?? "" + return value + } +} + +extension SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination { + + static func write(value: SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["eventDestinationArn"].write(value.eventDestinationArn) + } + + static func read(from reader: SmithyJSON.Reader) throws -> SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination() + value.eventDestinationArn = try reader["eventDestinationArn"].readIfPresent() ?? "" + return value + } +} + +extension SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountSummary { + + static func read(from reader: SmithyJSON.Reader) throws -> SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountSummary { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = SocialMessagingClientTypes.LinkedWhatsAppBusinessAccountSummary() + value.arn = try reader["arn"].readIfPresent() ?? "" + value.id = try reader["id"].readIfPresent() ?? "" + value.wabaId = try reader["wabaId"].readIfPresent() ?? "" + value.registrationStatus = try reader["registrationStatus"].readIfPresent() ?? .sdkUnknown("") + value.linkDate = try reader["linkDate"].readTimestampIfPresent(format: SmithyTimestamps.TimestampFormat.epochSeconds) ?? SmithyTimestamps.TimestampFormatter(format: .dateTime).date(from: "1970-01-01T00:00:00Z") + value.wabaName = try reader["wabaName"].readIfPresent() ?? "" + value.eventDestinations = try reader["eventDestinations"].readListIfPresent(memberReadingClosure: SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination.read(from:), memberNodeInfo: "member", isFlattened: false) ?? [] + return value + } +} + +extension SocialMessagingClientTypes.Tag { + + static func write(value: SocialMessagingClientTypes.Tag?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["key"].write(value.key) + try writer["value"].write(value.value) + } + + static func read(from reader: SmithyJSON.Reader) throws -> SocialMessagingClientTypes.Tag { + guard reader.hasContent else { throw SmithyReadWrite.ReaderError.requiredValueNotPresent } + var value = SocialMessagingClientTypes.Tag() + value.key = try reader["key"].readIfPresent() ?? "" + value.value = try reader["value"].readIfPresent() + return value + } +} + +extension SocialMessagingClientTypes.WhatsAppSignupCallback { + + static func write(value: SocialMessagingClientTypes.WhatsAppSignupCallback?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["accessToken"].write(value.accessToken) + } +} + +extension SocialMessagingClientTypes.WhatsAppSetupFinalization { + + static func write(value: SocialMessagingClientTypes.WhatsAppSetupFinalization?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["associateInProgressToken"].write(value.associateInProgressToken) + try writer["phoneNumberParent"].write(value.phoneNumberParent) + try writer["phoneNumbers"].writeList(value.phoneNumbers, memberWritingClosure: SocialMessagingClientTypes.WabaPhoneNumberSetupFinalization.write(value:to:), memberNodeInfo: "member", isFlattened: false) + try writer["waba"].write(value.waba, with: SocialMessagingClientTypes.WabaSetupFinalization.write(value:to:)) + } +} + +extension SocialMessagingClientTypes.WabaSetupFinalization { + + static func write(value: SocialMessagingClientTypes.WabaSetupFinalization?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["eventDestinations"].writeList(value.eventDestinations, memberWritingClosure: SocialMessagingClientTypes.WhatsAppBusinessAccountEventDestination.write(value:to:), memberNodeInfo: "member", isFlattened: false) + try writer["id"].write(value.id) + try writer["tags"].writeList(value.tags, memberWritingClosure: SocialMessagingClientTypes.Tag.write(value:to:), memberNodeInfo: "member", isFlattened: false) + } +} + +extension SocialMessagingClientTypes.WabaPhoneNumberSetupFinalization { + + static func write(value: SocialMessagingClientTypes.WabaPhoneNumberSetupFinalization?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["dataLocalizationRegion"].write(value.dataLocalizationRegion) + try writer["id"].write(value.id) + try writer["tags"].writeList(value.tags, memberWritingClosure: SocialMessagingClientTypes.Tag.write(value:to:), memberNodeInfo: "member", isFlattened: false) + try writer["twoFactorPin"].write(value.twoFactorPin) + } +} + +extension SocialMessagingClientTypes.S3PresignedUrl { + + static func write(value: SocialMessagingClientTypes.S3PresignedUrl?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["headers"].writeMap(value.headers, valueWritingClosure: SmithyReadWrite.WritingClosures.writeString(value:to:), keyNodeInfo: "key", valueNodeInfo: "value", isFlattened: false) + try writer["url"].write(value.url) + } +} + +extension SocialMessagingClientTypes.S3File { + + static func write(value: SocialMessagingClientTypes.S3File?, to writer: SmithyJSON.Writer) throws { + guard let value else { return } + try writer["bucketName"].write(value.bucketName) + try writer["key"].write(value.key) + } +} + +public enum SocialMessagingClientTypes {} diff --git a/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Plugins.swift b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Plugins.swift new file mode 100644 index 00000000000..0360498da42 --- /dev/null +++ b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Plugins.swift @@ -0,0 +1,82 @@ +// +// 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 class AWSClientRuntime.AWSClientConfigDefaultsProvider +import protocol ClientRuntime.ClientConfiguration +import protocol ClientRuntime.Plugin +import protocol SmithyHTTPAuthAPI.AuthSchemeResolver +import protocol SmithyIdentity.AWSCredentialIdentityResolver +import protocol SmithyIdentity.BearerTokenIdentityResolver +import struct AWSSDKHTTPAuth.SigV4AuthScheme +import struct SmithyIdentity.BearerTokenIdentity +import struct SmithyIdentity.StaticBearerTokenIdentityResolver +import typealias SmithyHTTPAuthAPI.AuthSchemes + +public class SocialMessagingClientEndpointPlugin: Plugin { + private var endpointResolver: EndpointResolver + + public init(endpointResolver: EndpointResolver) { + self.endpointResolver = endpointResolver + } + + public convenience init() throws { + self.init(endpointResolver: try DefaultEndpointResolver()) + } + + public func configureClient(clientConfiguration: ClientRuntime.ClientConfiguration) throws { + if let config = clientConfiguration as? SocialMessagingClient.SocialMessagingClientConfiguration { + config.endpointResolver = self.endpointResolver + } + } +} + +public class DefaultAWSAuthSchemePlugin: ClientRuntime.Plugin { + + public init() {} + + public func configureClient(clientConfiguration: ClientRuntime.ClientConfiguration) throws { + if let config = clientConfiguration as? SocialMessagingClient.SocialMessagingClientConfiguration { + config.authSchemeResolver = DefaultSocialMessagingAuthSchemeResolver() + config.authSchemes = [AWSSDKHTTPAuth.SigV4AuthScheme()] + config.awsCredentialIdentityResolver = try AWSClientRuntime.AWSClientConfigDefaultsProvider.awsCredentialIdentityResolver() + config.bearerTokenIdentityResolver = SmithyIdentity.StaticBearerTokenIdentityResolver(token: SmithyIdentity.BearerTokenIdentity(token: "")) + } + } +} + +public class SocialMessagingClientAuthSchemePlugin: ClientRuntime.Plugin { + private var authSchemes: SmithyHTTPAuthAPI.AuthSchemes? + private var authSchemeResolver: SmithyHTTPAuthAPI.AuthSchemeResolver? + private var awsCredentialIdentityResolver: (any SmithyIdentity.AWSCredentialIdentityResolver)? + private var bearerTokenIdentityResolver: (any SmithyIdentity.BearerTokenIdentityResolver)? + + public init(authSchemes: SmithyHTTPAuthAPI.AuthSchemes? = nil, authSchemeResolver: SocialMessagingAuthSchemeResolver? = nil, awsCredentialIdentityResolver: (any SmithyIdentity.AWSCredentialIdentityResolver)? = nil, bearerTokenIdentityResolver: (any SmithyIdentity.BearerTokenIdentityResolver)? = nil) { + self.authSchemeResolver = authSchemeResolver + self.authSchemes = authSchemes + self.awsCredentialIdentityResolver = awsCredentialIdentityResolver + self.bearerTokenIdentityResolver = bearerTokenIdentityResolver + } + + public func configureClient(clientConfiguration: ClientRuntime.ClientConfiguration) throws { + if let config = clientConfiguration as? SocialMessagingClient.SocialMessagingClientConfiguration { + if (self.authSchemes != nil) { + config.authSchemes = self.authSchemes + } + if (self.authSchemeResolver != nil) { + config.authSchemeResolver = self.authSchemeResolver! + } + if (self.awsCredentialIdentityResolver != nil) { + config.awsCredentialIdentityResolver = self.awsCredentialIdentityResolver! + } + if (self.bearerTokenIdentityResolver != nil) { + config.bearerTokenIdentityResolver = self.bearerTokenIdentityResolver! + } + } + } +} diff --git a/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Resources/Package.version b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Resources/Package.version new file mode 100644 index 00000000000..d3827e75a5c --- /dev/null +++ b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/Resources/Package.version @@ -0,0 +1 @@ +1.0 diff --git a/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/SocialMessagingClient.swift b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/SocialMessagingClient.swift new file mode 100644 index 00000000000..ee4f1df29c9 --- /dev/null +++ b/Sources/Services/AWSSocialMessaging/Sources/AWSSocialMessaging/SocialMessagingClient.swift @@ -0,0 +1,1151 @@ +// +// 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 Foundation +import class AWSClientRuntime.AWSClientConfigDefaultsProvider +import class AWSClientRuntime.AmzSdkRequestMiddleware +import class AWSClientRuntime.DefaultAWSClientPlugin +import class ClientRuntime.ClientBuilder +import class ClientRuntime.DefaultClientPlugin +import class ClientRuntime.HttpClientConfiguration +import class ClientRuntime.OrchestratorBuilder +import class ClientRuntime.OrchestratorTelemetry +import class ClientRuntime.SdkHttpClient +import class Smithy.ContextBuilder +import class SmithyHTTPAPI.HTTPRequest +import class SmithyHTTPAPI.HTTPResponse +@_spi(SmithyReadWrite) import class SmithyJSON.Writer +import enum AWSClientRuntime.AWSRetryErrorInfoProvider +import enum AWSClientRuntime.AWSRetryMode +import enum ClientRuntime.ClientLogMode +import enum ClientRuntime.DefaultTelemetry +import enum ClientRuntime.OrchestratorMetricsAttributesKeys +import protocol AWSClientRuntime.AWSDefaultClientConfiguration +import protocol AWSClientRuntime.AWSRegionClientConfiguration +import protocol ClientRuntime.Client +import protocol ClientRuntime.DefaultClientConfiguration +import protocol ClientRuntime.DefaultHttpClientConfiguration +import protocol ClientRuntime.HttpInterceptorProvider +import protocol ClientRuntime.IdempotencyTokenGenerator +import protocol ClientRuntime.InterceptorProvider +import protocol ClientRuntime.TelemetryProvider +import protocol Smithy.LogAgent +import protocol SmithyHTTPAPI.HTTPClient +import protocol SmithyHTTPAuthAPI.AuthSchemeResolver +import protocol SmithyIdentity.AWSCredentialIdentityResolver +import protocol SmithyIdentity.BearerTokenIdentityResolver +@_spi(SmithyReadWrite) import protocol SmithyReadWrite.SmithyWriter +import struct AWSClientRuntime.AmzSdkInvocationIdMiddleware +import struct AWSClientRuntime.EndpointResolverMiddleware +import struct AWSClientRuntime.UserAgentMiddleware +import struct AWSSDKHTTPAuth.SigV4AuthScheme +import struct ClientRuntime.AuthSchemeMiddleware +@_spi(SmithyReadWrite) import struct ClientRuntime.BodyMiddleware +import struct ClientRuntime.ContentLengthMiddleware +import struct ClientRuntime.ContentTypeMiddleware +@_spi(SmithyReadWrite) import struct ClientRuntime.DeserializeMiddleware +import struct ClientRuntime.LoggerMiddleware +import struct ClientRuntime.QueryItemMiddleware +import struct ClientRuntime.SignerMiddleware +import struct ClientRuntime.URLHostMiddleware +import struct ClientRuntime.URLPathMiddleware +import struct Smithy.Attributes +import struct SmithyIdentity.BearerTokenIdentity +import struct SmithyIdentity.StaticBearerTokenIdentityResolver +import struct SmithyRetries.DefaultRetryStrategy +import struct SmithyRetriesAPI.RetryStrategyOptions +import typealias SmithyHTTPAuthAPI.AuthSchemes + +public class SocialMessagingClient: ClientRuntime.Client { + public static let clientName = "SocialMessagingClient" + let client: ClientRuntime.SdkHttpClient + let config: SocialMessagingClient.SocialMessagingClientConfiguration + let serviceName = "SocialMessaging" + + public required init(config: SocialMessagingClient.SocialMessagingClientConfiguration) { + client = ClientRuntime.SdkHttpClient(engine: config.httpClientEngine, config: config.httpClientConfiguration) + self.config = config + } + + public convenience init(region: Swift.String) throws { + let config = try SocialMessagingClient.SocialMessagingClientConfiguration(region: region) + self.init(config: config) + } + + public convenience required init() async throws { + let config = try await SocialMessagingClient.SocialMessagingClientConfiguration() + self.init(config: config) + } +} + +extension SocialMessagingClient { + public class SocialMessagingClientConfiguration: AWSClientRuntime.AWSDefaultClientConfiguration & AWSClientRuntime.AWSRegionClientConfiguration & ClientRuntime.DefaultClientConfiguration & ClientRuntime.DefaultHttpClientConfiguration { + public var useFIPS: Swift.Bool? + + public var useDualStack: Swift.Bool? + + public var appID: Swift.String? + + public var awsCredentialIdentityResolver: any SmithyIdentity.AWSCredentialIdentityResolver + + public var awsRetryMode: AWSClientRuntime.AWSRetryMode + + public var maxAttempts: Swift.Int? + + public var region: Swift.String? + + public var signingRegion: Swift.String? + + public var endpointResolver: EndpointResolver + + public var telemetryProvider: ClientRuntime.TelemetryProvider + + public var retryStrategyOptions: SmithyRetriesAPI.RetryStrategyOptions + + public var clientLogMode: ClientRuntime.ClientLogMode + + public var endpoint: Swift.String? + + public var idempotencyTokenGenerator: ClientRuntime.IdempotencyTokenGenerator + + public var httpClientEngine: SmithyHTTPAPI.HTTPClient + + public var httpClientConfiguration: ClientRuntime.HttpClientConfiguration + + public var authSchemes: SmithyHTTPAuthAPI.AuthSchemes? + + public var authSchemeResolver: SmithyHTTPAuthAPI.AuthSchemeResolver + + public var bearerTokenIdentityResolver: any SmithyIdentity.BearerTokenIdentityResolver + + public private(set) var interceptorProviders: [ClientRuntime.InterceptorProvider] + + public private(set) var httpInterceptorProviders: [ClientRuntime.HttpInterceptorProvider] + + internal let logger: Smithy.LogAgent + + private init(_ useFIPS: Swift.Bool?, _ useDualStack: Swift.Bool?, _ appID: Swift.String?, _ awsCredentialIdentityResolver: any SmithyIdentity.AWSCredentialIdentityResolver, _ awsRetryMode: AWSClientRuntime.AWSRetryMode, _ maxAttempts: Swift.Int?, _ region: Swift.String?, _ signingRegion: Swift.String?, _ endpointResolver: EndpointResolver, _ telemetryProvider: ClientRuntime.TelemetryProvider, _ retryStrategyOptions: SmithyRetriesAPI.RetryStrategyOptions, _ clientLogMode: ClientRuntime.ClientLogMode, _ endpoint: Swift.String?, _ idempotencyTokenGenerator: ClientRuntime.IdempotencyTokenGenerator, _ httpClientEngine: SmithyHTTPAPI.HTTPClient, _ httpClientConfiguration: ClientRuntime.HttpClientConfiguration, _ authSchemes: SmithyHTTPAuthAPI.AuthSchemes?, _ authSchemeResolver: SmithyHTTPAuthAPI.AuthSchemeResolver, _ bearerTokenIdentityResolver: any SmithyIdentity.BearerTokenIdentityResolver, _ interceptorProviders: [ClientRuntime.InterceptorProvider], _ httpInterceptorProviders: [ClientRuntime.HttpInterceptorProvider]) { + self.useFIPS = useFIPS + self.useDualStack = useDualStack + self.appID = appID + self.awsCredentialIdentityResolver = awsCredentialIdentityResolver + self.awsRetryMode = awsRetryMode + self.maxAttempts = maxAttempts + self.region = region + self.signingRegion = signingRegion + self.endpointResolver = endpointResolver + self.telemetryProvider = telemetryProvider + self.retryStrategyOptions = retryStrategyOptions + self.clientLogMode = clientLogMode + self.endpoint = endpoint + self.idempotencyTokenGenerator = idempotencyTokenGenerator + self.httpClientEngine = httpClientEngine + self.httpClientConfiguration = httpClientConfiguration + self.authSchemes = authSchemes + self.authSchemeResolver = authSchemeResolver + self.bearerTokenIdentityResolver = bearerTokenIdentityResolver + self.interceptorProviders = interceptorProviders + self.httpInterceptorProviders = httpInterceptorProviders + self.logger = telemetryProvider.loggerProvider.getLogger(name: SocialMessagingClient.clientName) + } + + public convenience init(useFIPS: Swift.Bool? = nil, useDualStack: Swift.Bool? = nil, appID: Swift.String? = nil, awsCredentialIdentityResolver: (any SmithyIdentity.AWSCredentialIdentityResolver)? = nil, awsRetryMode: AWSClientRuntime.AWSRetryMode? = nil, maxAttempts: Swift.Int? = nil, region: Swift.String? = nil, signingRegion: Swift.String? = nil, endpointResolver: EndpointResolver? = nil, telemetryProvider: ClientRuntime.TelemetryProvider? = nil, retryStrategyOptions: SmithyRetriesAPI.RetryStrategyOptions? = nil, clientLogMode: ClientRuntime.ClientLogMode? = nil, endpoint: Swift.String? = nil, idempotencyTokenGenerator: ClientRuntime.IdempotencyTokenGenerator? = nil, httpClientEngine: SmithyHTTPAPI.HTTPClient? = nil, httpClientConfiguration: ClientRuntime.HttpClientConfiguration? = nil, authSchemes: SmithyHTTPAuthAPI.AuthSchemes? = nil, authSchemeResolver: SmithyHTTPAuthAPI.AuthSchemeResolver? = nil, bearerTokenIdentityResolver: (any SmithyIdentity.BearerTokenIdentityResolver)? = nil, interceptorProviders: [ClientRuntime.InterceptorProvider]? = nil, httpInterceptorProviders: [ClientRuntime.HttpInterceptorProvider]? = nil) throws { + self.init(useFIPS, useDualStack, try appID ?? AWSClientRuntime.AWSClientConfigDefaultsProvider.appID(), try awsCredentialIdentityResolver ?? AWSClientRuntime.AWSClientConfigDefaultsProvider.awsCredentialIdentityResolver(awsCredentialIdentityResolver), try awsRetryMode ?? AWSClientRuntime.AWSClientConfigDefaultsProvider.retryMode(), maxAttempts, region, signingRegion, try endpointResolver ?? DefaultEndpointResolver(), telemetryProvider ?? ClientRuntime.DefaultTelemetry.provider, try retryStrategyOptions ?? AWSClientConfigDefaultsProvider.retryStrategyOptions(awsRetryMode, maxAttempts), clientLogMode ?? AWSClientConfigDefaultsProvider.clientLogMode(), endpoint, idempotencyTokenGenerator ?? AWSClientConfigDefaultsProvider.idempotencyTokenGenerator(), httpClientEngine ?? AWSClientConfigDefaultsProvider.httpClientEngine(), httpClientConfiguration ?? AWSClientConfigDefaultsProvider.httpClientConfiguration(), authSchemes ?? [AWSSDKHTTPAuth.SigV4AuthScheme()], authSchemeResolver ?? DefaultSocialMessagingAuthSchemeResolver(), bearerTokenIdentityResolver ?? SmithyIdentity.StaticBearerTokenIdentityResolver(token: SmithyIdentity.BearerTokenIdentity(token: "")), interceptorProviders ?? [], httpInterceptorProviders ?? []) + } + + public convenience init(useFIPS: Swift.Bool? = nil, useDualStack: Swift.Bool? = nil, appID: Swift.String? = nil, awsCredentialIdentityResolver: (any SmithyIdentity.AWSCredentialIdentityResolver)? = nil, awsRetryMode: AWSClientRuntime.AWSRetryMode? = nil, maxAttempts: Swift.Int? = nil, region: Swift.String? = nil, signingRegion: Swift.String? = nil, endpointResolver: EndpointResolver? = nil, telemetryProvider: ClientRuntime.TelemetryProvider? = nil, retryStrategyOptions: SmithyRetriesAPI.RetryStrategyOptions? = nil, clientLogMode: ClientRuntime.ClientLogMode? = nil, endpoint: Swift.String? = nil, idempotencyTokenGenerator: ClientRuntime.IdempotencyTokenGenerator? = nil, httpClientEngine: SmithyHTTPAPI.HTTPClient? = nil, httpClientConfiguration: ClientRuntime.HttpClientConfiguration? = nil, authSchemes: SmithyHTTPAuthAPI.AuthSchemes? = nil, authSchemeResolver: SmithyHTTPAuthAPI.AuthSchemeResolver? = nil, bearerTokenIdentityResolver: (any SmithyIdentity.BearerTokenIdentityResolver)? = nil, interceptorProviders: [ClientRuntime.InterceptorProvider]? = nil, httpInterceptorProviders: [ClientRuntime.HttpInterceptorProvider]? = nil) async throws { + self.init(useFIPS, useDualStack, try appID ?? AWSClientRuntime.AWSClientConfigDefaultsProvider.appID(), try awsCredentialIdentityResolver ?? AWSClientRuntime.AWSClientConfigDefaultsProvider.awsCredentialIdentityResolver(awsCredentialIdentityResolver), try awsRetryMode ?? AWSClientRuntime.AWSClientConfigDefaultsProvider.retryMode(), maxAttempts, try await AWSClientRuntime.AWSClientConfigDefaultsProvider.region(region), try await AWSClientRuntime.AWSClientConfigDefaultsProvider.region(region), try endpointResolver ?? DefaultEndpointResolver(), telemetryProvider ?? ClientRuntime.DefaultTelemetry.provider, try retryStrategyOptions ?? AWSClientConfigDefaultsProvider.retryStrategyOptions(awsRetryMode, maxAttempts), clientLogMode ?? AWSClientConfigDefaultsProvider.clientLogMode(), endpoint, idempotencyTokenGenerator ?? AWSClientConfigDefaultsProvider.idempotencyTokenGenerator(), httpClientEngine ?? AWSClientConfigDefaultsProvider.httpClientEngine(), httpClientConfiguration ?? AWSClientConfigDefaultsProvider.httpClientConfiguration(), authSchemes ?? [AWSSDKHTTPAuth.SigV4AuthScheme()], authSchemeResolver ?? DefaultSocialMessagingAuthSchemeResolver(), bearerTokenIdentityResolver ?? SmithyIdentity.StaticBearerTokenIdentityResolver(token: SmithyIdentity.BearerTokenIdentity(token: "")), interceptorProviders ?? [], httpInterceptorProviders ?? []) + } + + public convenience required init() async throws { + try await self.init(useFIPS: nil, useDualStack: nil, appID: nil, awsCredentialIdentityResolver: nil, awsRetryMode: nil, maxAttempts: nil, region: nil, signingRegion: nil, endpointResolver: nil, telemetryProvider: nil, retryStrategyOptions: nil, clientLogMode: nil, endpoint: nil, idempotencyTokenGenerator: nil, httpClientEngine: nil, httpClientConfiguration: nil, authSchemes: nil, authSchemeResolver: nil, bearerTokenIdentityResolver: nil, interceptorProviders: nil, httpInterceptorProviders: nil) + } + + public convenience init(region: String) throws { + self.init(nil, nil, try AWSClientRuntime.AWSClientConfigDefaultsProvider.appID(), try AWSClientConfigDefaultsProvider.awsCredentialIdentityResolver(), try AWSClientRuntime.AWSClientConfigDefaultsProvider.retryMode(), nil, region, region, try DefaultEndpointResolver(), ClientRuntime.DefaultTelemetry.provider, try AWSClientConfigDefaultsProvider.retryStrategyOptions(), AWSClientConfigDefaultsProvider.clientLogMode(), nil, AWSClientConfigDefaultsProvider.idempotencyTokenGenerator(), AWSClientConfigDefaultsProvider.httpClientEngine(), AWSClientConfigDefaultsProvider.httpClientConfiguration(), [AWSSDKHTTPAuth.SigV4AuthScheme()], DefaultSocialMessagingAuthSchemeResolver(), SmithyIdentity.StaticBearerTokenIdentityResolver(token: SmithyIdentity.BearerTokenIdentity(token: "")), [], []) + } + + public var partitionID: String? { + return "\(SocialMessagingClient.clientName) - \(region ?? "")" + } + public func addInterceptorProvider(_ provider: ClientRuntime.InterceptorProvider) { + self.interceptorProviders.append(provider) + } + + public func addInterceptorProvider(_ provider: ClientRuntime.HttpInterceptorProvider) { + self.httpInterceptorProviders.append(provider) + } + + } + + public static func builder() -> ClientRuntime.ClientBuilder { + return ClientRuntime.ClientBuilder(defaultPlugins: [ + ClientRuntime.DefaultClientPlugin(), + AWSClientRuntime.DefaultAWSClientPlugin(clientName: self.clientName), + DefaultAWSAuthSchemePlugin() + ]) + } +} + +extension SocialMessagingClient { + /// Performs the `AssociateWhatsAppBusinessAccount` operation on the `SocialMessaging` service. + /// + /// This is only used through the Amazon Web Services console during sign-up to associate your WhatsApp Business Account to your Amazon Web Services account. + /// + /// - Parameter AssociateWhatsAppBusinessAccountInput : [no documentation found] + /// + /// - Returns: `AssociateWhatsAppBusinessAccountOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `DependencyException` : Thrown when performing an action because a dependency would be broken. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func associateWhatsAppBusinessAccount(input: AssociateWhatsAppBusinessAccountInput) async throws -> AssociateWhatsAppBusinessAccountOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "associateWhatsAppBusinessAccount") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(AssociateWhatsAppBusinessAccountInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/json")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: AssociateWhatsAppBusinessAccountInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(AssociateWhatsAppBusinessAccountOutput.httpOutput(from:), AssociateWhatsAppBusinessAccountOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "AssociateWhatsAppBusinessAccount") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `DeleteWhatsAppMessageMedia` operation on the `SocialMessaging` service. + /// + /// Delete a media object from the WhatsApp service. If the object is still in an Amazon S3 bucket you should delete it from there too. + /// + /// - Parameter DeleteWhatsAppMessageMediaInput : [no documentation found] + /// + /// - Returns: `DeleteWhatsAppMessageMediaOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedByMetaException` : You do not have sufficient access to perform this action. + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `DependencyException` : Thrown when performing an action because a dependency would be broken. + /// - `InternalServiceException` : The request processing has failed because of an unknown error, exception, or failure. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ResourceNotFoundException` : The resource was not found. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func deleteWhatsAppMessageMedia(input: DeleteWhatsAppMessageMediaInput) async throws -> DeleteWhatsAppMessageMediaOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .delete) + .withServiceName(value: serviceName) + .withOperation(value: "deleteWhatsAppMessageMedia") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(DeleteWhatsAppMessageMediaInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.serialize(ClientRuntime.QueryItemMiddleware(DeleteWhatsAppMessageMediaInput.queryItemProvider(_:))) + builder.deserialize(ClientRuntime.DeserializeMiddleware(DeleteWhatsAppMessageMediaOutput.httpOutput(from:), DeleteWhatsAppMessageMediaOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "DeleteWhatsAppMessageMedia") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `DisassociateWhatsAppBusinessAccount` operation on the `SocialMessaging` service. + /// + /// Disassociate a WhatsApp Business Account (WABA) from your Amazon Web Services account. + /// + /// - Parameter DisassociateWhatsAppBusinessAccountInput : [no documentation found] + /// + /// - Returns: `DisassociateWhatsAppBusinessAccountOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `DependencyException` : Thrown when performing an action because a dependency would be broken. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ResourceNotFoundException` : The resource was not found. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func disassociateWhatsAppBusinessAccount(input: DisassociateWhatsAppBusinessAccountInput) async throws -> DisassociateWhatsAppBusinessAccountOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .delete) + .withServiceName(value: serviceName) + .withOperation(value: "disassociateWhatsAppBusinessAccount") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(DisassociateWhatsAppBusinessAccountInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.serialize(ClientRuntime.QueryItemMiddleware(DisassociateWhatsAppBusinessAccountInput.queryItemProvider(_:))) + builder.deserialize(ClientRuntime.DeserializeMiddleware(DisassociateWhatsAppBusinessAccountOutput.httpOutput(from:), DisassociateWhatsAppBusinessAccountOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "DisassociateWhatsAppBusinessAccount") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `GetLinkedWhatsAppBusinessAccount` operation on the `SocialMessaging` service. + /// + /// Get the details of your linked WhatsApp Business Account. + /// + /// - Parameter GetLinkedWhatsAppBusinessAccountInput : [no documentation found] + /// + /// - Returns: `GetLinkedWhatsAppBusinessAccountOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `DependencyException` : Thrown when performing an action because a dependency would be broken. + /// - `InternalServiceException` : The request processing has failed because of an unknown error, exception, or failure. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ResourceNotFoundException` : The resource was not found. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func getLinkedWhatsAppBusinessAccount(input: GetLinkedWhatsAppBusinessAccountInput) async throws -> GetLinkedWhatsAppBusinessAccountOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .get) + .withServiceName(value: serviceName) + .withOperation(value: "getLinkedWhatsAppBusinessAccount") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(GetLinkedWhatsAppBusinessAccountInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.serialize(ClientRuntime.QueryItemMiddleware(GetLinkedWhatsAppBusinessAccountInput.queryItemProvider(_:))) + builder.deserialize(ClientRuntime.DeserializeMiddleware(GetLinkedWhatsAppBusinessAccountOutput.httpOutput(from:), GetLinkedWhatsAppBusinessAccountOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "GetLinkedWhatsAppBusinessAccount") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `GetLinkedWhatsAppBusinessAccountPhoneNumber` operation on the `SocialMessaging` service. + /// + /// Use your WhatsApp phone number id to get the WABA account id and phone number details. + /// + /// - Parameter GetLinkedWhatsAppBusinessAccountPhoneNumberInput : [no documentation found] + /// + /// - Returns: `GetLinkedWhatsAppBusinessAccountPhoneNumberOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `DependencyException` : Thrown when performing an action because a dependency would be broken. + /// - `InternalServiceException` : The request processing has failed because of an unknown error, exception, or failure. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ResourceNotFoundException` : The resource was not found. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func getLinkedWhatsAppBusinessAccountPhoneNumber(input: GetLinkedWhatsAppBusinessAccountPhoneNumberInput) async throws -> GetLinkedWhatsAppBusinessAccountPhoneNumberOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .get) + .withServiceName(value: serviceName) + .withOperation(value: "getLinkedWhatsAppBusinessAccountPhoneNumber") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(GetLinkedWhatsAppBusinessAccountPhoneNumberInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.serialize(ClientRuntime.QueryItemMiddleware(GetLinkedWhatsAppBusinessAccountPhoneNumberInput.queryItemProvider(_:))) + builder.deserialize(ClientRuntime.DeserializeMiddleware(GetLinkedWhatsAppBusinessAccountPhoneNumberOutput.httpOutput(from:), GetLinkedWhatsAppBusinessAccountPhoneNumberOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "GetLinkedWhatsAppBusinessAccountPhoneNumber") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `GetWhatsAppMessageMedia` operation on the `SocialMessaging` service. + /// + /// Get a media file from the WhatsApp service. On successful completion the media file is retrieved from Meta and stored in the specified Amazon S3 bucket. Use either destinationS3File or destinationS3PresignedUrl for the destination. If both are used then an InvalidParameterException is returned. + /// + /// - Parameter GetWhatsAppMessageMediaInput : [no documentation found] + /// + /// - Returns: `GetWhatsAppMessageMediaOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedByMetaException` : You do not have sufficient access to perform this action. + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `DependencyException` : Thrown when performing an action because a dependency would be broken. + /// - `InternalServiceException` : The request processing has failed because of an unknown error, exception, or failure. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ResourceNotFoundException` : The resource was not found. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func getWhatsAppMessageMedia(input: GetWhatsAppMessageMediaInput) async throws -> GetWhatsAppMessageMediaOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "getWhatsAppMessageMedia") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(GetWhatsAppMessageMediaInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/json")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: GetWhatsAppMessageMediaInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(GetWhatsAppMessageMediaOutput.httpOutput(from:), GetWhatsAppMessageMediaOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "GetWhatsAppMessageMedia") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `ListLinkedWhatsAppBusinessAccounts` operation on the `SocialMessaging` service. + /// + /// List all WhatsApp Business Accounts linked to your Amazon Web Services account. + /// + /// - Parameter ListLinkedWhatsAppBusinessAccountsInput : [no documentation found] + /// + /// - Returns: `ListLinkedWhatsAppBusinessAccountsOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `InternalServiceException` : The request processing has failed because of an unknown error, exception, or failure. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ResourceNotFoundException` : The resource was not found. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func listLinkedWhatsAppBusinessAccounts(input: ListLinkedWhatsAppBusinessAccountsInput) async throws -> ListLinkedWhatsAppBusinessAccountsOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .get) + .withServiceName(value: serviceName) + .withOperation(value: "listLinkedWhatsAppBusinessAccounts") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(ListLinkedWhatsAppBusinessAccountsInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.serialize(ClientRuntime.QueryItemMiddleware(ListLinkedWhatsAppBusinessAccountsInput.queryItemProvider(_:))) + builder.deserialize(ClientRuntime.DeserializeMiddleware(ListLinkedWhatsAppBusinessAccountsOutput.httpOutput(from:), ListLinkedWhatsAppBusinessAccountsOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "ListLinkedWhatsAppBusinessAccounts") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `ListTagsForResource` operation on the `SocialMessaging` service. + /// + /// List all tags associated with a resource, such as a phone number or WABA. + /// + /// - Parameter ListTagsForResourceInput : [no documentation found] + /// + /// - Returns: `ListTagsForResourceOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `InternalServiceException` : The request processing has failed because of an unknown error, exception, or failure. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func listTagsForResource(input: ListTagsForResourceInput) async throws -> ListTagsForResourceOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .get) + .withServiceName(value: serviceName) + .withOperation(value: "listTagsForResource") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(ListTagsForResourceInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.serialize(ClientRuntime.QueryItemMiddleware(ListTagsForResourceInput.queryItemProvider(_:))) + builder.deserialize(ClientRuntime.DeserializeMiddleware(ListTagsForResourceOutput.httpOutput(from:), ListTagsForResourceOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "ListTagsForResource") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `PostWhatsAppMessageMedia` operation on the `SocialMessaging` service. + /// + /// Upload a media file to the WhatsApp service. Only the specified originationPhoneNumberId has the permissions to send the media file when using [SendWhatsAppMessage](https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_SendWhatsAppMessage.html). You must use either sourceS3File or sourceS3PresignedUrl for the source. If both or neither are specified then an InvalidParameterException is returned. + /// + /// - Parameter PostWhatsAppMessageMediaInput : [no documentation found] + /// + /// - Returns: `PostWhatsAppMessageMediaOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedByMetaException` : You do not have sufficient access to perform this action. + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `DependencyException` : Thrown when performing an action because a dependency would be broken. + /// - `InternalServiceException` : The request processing has failed because of an unknown error, exception, or failure. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ResourceNotFoundException` : The resource was not found. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func postWhatsAppMessageMedia(input: PostWhatsAppMessageMediaInput) async throws -> PostWhatsAppMessageMediaOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "postWhatsAppMessageMedia") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(PostWhatsAppMessageMediaInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/json")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: PostWhatsAppMessageMediaInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(PostWhatsAppMessageMediaOutput.httpOutput(from:), PostWhatsAppMessageMediaOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "PostWhatsAppMessageMedia") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `PutWhatsAppBusinessAccountEventDestinations` operation on the `SocialMessaging` service. + /// + /// Add an event destination to log event data from WhatsApp for a WhatsApp Business Account (WABA). A WABA can only have one event destination at a time. All resources associated with the WABA use the same event destination. + /// + /// - Parameter PutWhatsAppBusinessAccountEventDestinationsInput : [no documentation found] + /// + /// - Returns: `PutWhatsAppBusinessAccountEventDestinationsOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `InternalServiceException` : The request processing has failed because of an unknown error, exception, or failure. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func putWhatsAppBusinessAccountEventDestinations(input: PutWhatsAppBusinessAccountEventDestinationsInput) async throws -> PutWhatsAppBusinessAccountEventDestinationsOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .put) + .withServiceName(value: serviceName) + .withOperation(value: "putWhatsAppBusinessAccountEventDestinations") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(PutWhatsAppBusinessAccountEventDestinationsInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/json")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: PutWhatsAppBusinessAccountEventDestinationsInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(PutWhatsAppBusinessAccountEventDestinationsOutput.httpOutput(from:), PutWhatsAppBusinessAccountEventDestinationsOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "PutWhatsAppBusinessAccountEventDestinations") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `SendWhatsAppMessage` operation on the `SocialMessaging` service. + /// + /// Send a WhatsApp message. For examples of sending a message using the Amazon Web Services CLI, see [Sending messages](https://docs.aws.amazon.com/social-messaging/latest/userguide/send-message.html) in the Amazon Web Services End User Messaging Social User Guide . + /// + /// - Parameter SendWhatsAppMessageInput : [no documentation found] + /// + /// - Returns: `SendWhatsAppMessageOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `DependencyException` : Thrown when performing an action because a dependency would be broken. + /// - `InternalServiceException` : The request processing has failed because of an unknown error, exception, or failure. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ResourceNotFoundException` : The resource was not found. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func sendWhatsAppMessage(input: SendWhatsAppMessageInput) async throws -> SendWhatsAppMessageOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "sendWhatsAppMessage") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(SendWhatsAppMessageInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/json")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: SendWhatsAppMessageInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(SendWhatsAppMessageOutput.httpOutput(from:), SendWhatsAppMessageOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "SendWhatsAppMessage") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `TagResource` operation on the `SocialMessaging` service. + /// + /// Adds or overwrites only the specified tags for the specified resource. When you specify an existing tag key, the value is overwritten with the new value. + /// + /// - Parameter TagResourceInput : [no documentation found] + /// + /// - Returns: `TagResourceOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `InternalServiceException` : The request processing has failed because of an unknown error, exception, or failure. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func tagResource(input: TagResourceInput) async throws -> TagResourceOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "tagResource") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(TagResourceInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/json")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: TagResourceInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(TagResourceOutput.httpOutput(from:), TagResourceOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "TagResource") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + + /// Performs the `UntagResource` operation on the `SocialMessaging` service. + /// + /// Removes the specified tags from a resource. + /// + /// - Parameter UntagResourceInput : [no documentation found] + /// + /// - Returns: `UntagResourceOutput` : [no documentation found] + /// + /// - Throws: One of the exceptions listed below __Possible Exceptions__. + /// + /// __Possible Exceptions:__ + /// - `AccessDeniedException` : You do not have sufficient access to perform this action. + /// - `InternalServiceException` : The request processing has failed because of an unknown error, exception, or failure. + /// - `InvalidParametersException` : One or more parameters provided to the action are not valid. + /// - `ThrottledRequestException` : The request was denied due to request throttling. + /// - `ValidationException` : The request contains an invalid parameter value. + public func untagResource(input: UntagResourceInput) async throws -> UntagResourceOutput { + let context = Smithy.ContextBuilder() + .withMethod(value: .post) + .withServiceName(value: serviceName) + .withOperation(value: "untagResource") + .withIdempotencyTokenGenerator(value: config.idempotencyTokenGenerator) + .withLogger(value: config.logger) + .withPartitionID(value: config.partitionID) + .withAuthSchemes(value: config.authSchemes ?? []) + .withAuthSchemeResolver(value: config.authSchemeResolver) + .withUnsignedPayloadTrait(value: false) + .withSocketTimeout(value: config.httpClientConfiguration.socketTimeout) + .withIdentityResolver(value: config.bearerTokenIdentityResolver, schemeID: "smithy.api#httpBearerAuth") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4") + .withIdentityResolver(value: config.awsCredentialIdentityResolver, schemeID: "aws.auth#sigv4a") + .withRegion(value: config.region) + .withSigningName(value: "social-messaging") + .withSigningRegion(value: config.signingRegion) + .build() + let builder = ClientRuntime.OrchestratorBuilder() + config.interceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + config.httpInterceptorProviders.forEach { provider in + builder.interceptors.add(provider.create()) + } + builder.interceptors.add(ClientRuntime.URLPathMiddleware(UntagResourceInput.urlPathProvider(_:))) + builder.interceptors.add(ClientRuntime.URLHostMiddleware()) + builder.interceptors.add(ClientRuntime.ContentTypeMiddleware(contentType: "application/json")) + builder.serialize(ClientRuntime.BodyMiddleware(rootNodeInfo: "", inputWritingClosure: UntagResourceInput.write(value:to:))) + builder.interceptors.add(ClientRuntime.ContentLengthMiddleware()) + builder.deserialize(ClientRuntime.DeserializeMiddleware(UntagResourceOutput.httpOutput(from:), UntagResourceOutputError.httpError(from:))) + builder.interceptors.add(ClientRuntime.LoggerMiddleware(clientLogMode: config.clientLogMode)) + builder.retryStrategy(SmithyRetries.DefaultRetryStrategy(options: config.retryStrategyOptions)) + builder.retryErrorInfoProvider(AWSClientRuntime.AWSRetryErrorInfoProvider.errorInfo(for:)) + builder.applySigner(ClientRuntime.SignerMiddleware()) + let endpointParams = EndpointParams(endpoint: config.endpoint, region: config.region, useDualStack: config.useDualStack ?? false, useFIPS: config.useFIPS ?? false) + builder.applyEndpoint(AWSClientRuntime.EndpointResolverMiddleware(endpointResolverBlock: { [config] in try config.endpointResolver.resolve(params: $0) }, endpointParams: endpointParams)) + builder.interceptors.add(AWSClientRuntime.UserAgentMiddleware(serviceID: serviceName, version: "1.0", config: config)) + builder.selectAuthScheme(ClientRuntime.AuthSchemeMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkInvocationIdMiddleware()) + builder.interceptors.add(AWSClientRuntime.AmzSdkRequestMiddleware(maxRetries: config.retryStrategyOptions.maxRetriesBase)) + var metricsAttributes = Smithy.Attributes() + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.service, value: "SocialMessaging") + metricsAttributes.set(key: ClientRuntime.OrchestratorMetricsAttributesKeys.method, value: "UntagResource") + let op = builder.attributes(context) + .telemetry(ClientRuntime.OrchestratorTelemetry( + telemetryProvider: config.telemetryProvider, + metricsAttributes: metricsAttributes, + meterScope: serviceName, + tracerScope: serviceName + )) + .executeRequest(client) + .build() + return try await op.execute(input: input) + } + +} diff --git a/Sources/Services/AWSSocialMessaging/Tests/AWSSocialMessagingTests/EndpointResolverTest.swift b/Sources/Services/AWSSocialMessaging/Tests/AWSSocialMessagingTests/EndpointResolverTest.swift new file mode 100644 index 00000000000..0bbcdd88d6b --- /dev/null +++ b/Sources/Services/AWSSocialMessaging/Tests/AWSSocialMessagingTests/EndpointResolverTest.swift @@ -0,0 +1,516 @@ +// +// 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! + +@testable import AWSSocialMessaging +import SmithyTestUtil +import XCTest +import enum ClientRuntime.EndpointError +import struct SmithyHTTPAPI.Endpoint +import struct SmithyHTTPAPI.Headers + +class EndpointResolverTest: XCTestCase { + + override class func setUp() { + SmithyTestUtil.TestInitializer.initialize() + } + + /// For region us-east-1 with FIPS enabled and DualStack enabled + func testResolve1() throws { + let endpointParams = EndpointParams( + region: "us-east-1", + useDualStack: true, + useFIPS: true + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging-fips.us-east-1.api.aws", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region us-east-1 with FIPS enabled and DualStack disabled + func testResolve2() throws { + let endpointParams = EndpointParams( + region: "us-east-1", + useDualStack: false, + useFIPS: true + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging-fips.us-east-1.amazonaws.com", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region us-east-1 with FIPS disabled and DualStack enabled + func testResolve3() throws { + let endpointParams = EndpointParams( + region: "us-east-1", + useDualStack: true, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging.us-east-1.api.aws", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region us-east-1 with FIPS disabled and DualStack disabled + func testResolve4() throws { + let endpointParams = EndpointParams( + region: "us-east-1", + useDualStack: false, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging.us-east-1.amazonaws.com", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region cn-north-1 with FIPS enabled and DualStack enabled + func testResolve5() throws { + let endpointParams = EndpointParams( + region: "cn-north-1", + useDualStack: true, + useFIPS: true + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging-fips.cn-north-1.api.amazonwebservices.com.cn", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region cn-north-1 with FIPS enabled and DualStack disabled + func testResolve6() throws { + let endpointParams = EndpointParams( + region: "cn-north-1", + useDualStack: false, + useFIPS: true + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging-fips.cn-north-1.amazonaws.com.cn", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region cn-north-1 with FIPS disabled and DualStack enabled + func testResolve7() throws { + let endpointParams = EndpointParams( + region: "cn-north-1", + useDualStack: true, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging.cn-north-1.api.amazonwebservices.com.cn", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region cn-north-1 with FIPS disabled and DualStack disabled + func testResolve8() throws { + let endpointParams = EndpointParams( + region: "cn-north-1", + useDualStack: false, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging.cn-north-1.amazonaws.com.cn", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region us-gov-east-1 with FIPS enabled and DualStack enabled + func testResolve9() throws { + let endpointParams = EndpointParams( + region: "us-gov-east-1", + useDualStack: true, + useFIPS: true + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging-fips.us-gov-east-1.api.aws", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region us-gov-east-1 with FIPS enabled and DualStack disabled + func testResolve10() throws { + let endpointParams = EndpointParams( + region: "us-gov-east-1", + useDualStack: false, + useFIPS: true + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging-fips.us-gov-east-1.amazonaws.com", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region us-gov-east-1 with FIPS disabled and DualStack enabled + func testResolve11() throws { + let endpointParams = EndpointParams( + region: "us-gov-east-1", + useDualStack: true, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging.us-gov-east-1.api.aws", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region us-gov-east-1 with FIPS disabled and DualStack disabled + func testResolve12() throws { + let endpointParams = EndpointParams( + region: "us-gov-east-1", + useDualStack: false, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging.us-gov-east-1.amazonaws.com", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region us-iso-east-1 with FIPS enabled and DualStack enabled + func testResolve13() throws { + let endpointParams = EndpointParams( + region: "us-iso-east-1", + useDualStack: true, + useFIPS: true + ) + let resolver = try DefaultEndpointResolver() + + XCTAssertThrowsError(try resolver.resolve(params: endpointParams)) { error in + switch error { + case ClientRuntime.EndpointError.unresolved(let message): + XCTAssertEqual("FIPS and DualStack are enabled, but this partition does not support one or both", message) + default: + XCTFail() + } + } + } + + /// For region us-iso-east-1 with FIPS enabled and DualStack disabled + func testResolve14() throws { + let endpointParams = EndpointParams( + region: "us-iso-east-1", + useDualStack: false, + useFIPS: true + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging-fips.us-iso-east-1.c2s.ic.gov", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region us-iso-east-1 with FIPS disabled and DualStack enabled + func testResolve15() throws { + let endpointParams = EndpointParams( + region: "us-iso-east-1", + useDualStack: true, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + XCTAssertThrowsError(try resolver.resolve(params: endpointParams)) { error in + switch error { + case ClientRuntime.EndpointError.unresolved(let message): + XCTAssertEqual("DualStack is enabled but this partition does not support DualStack", message) + default: + XCTFail() + } + } + } + + /// For region us-iso-east-1 with FIPS disabled and DualStack disabled + func testResolve16() throws { + let endpointParams = EndpointParams( + region: "us-iso-east-1", + useDualStack: false, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging.us-iso-east-1.c2s.ic.gov", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region us-isob-east-1 with FIPS enabled and DualStack enabled + func testResolve17() throws { + let endpointParams = EndpointParams( + region: "us-isob-east-1", + useDualStack: true, + useFIPS: true + ) + let resolver = try DefaultEndpointResolver() + + XCTAssertThrowsError(try resolver.resolve(params: endpointParams)) { error in + switch error { + case ClientRuntime.EndpointError.unresolved(let message): + XCTAssertEqual("FIPS and DualStack are enabled, but this partition does not support one or both", message) + default: + XCTFail() + } + } + } + + /// For region us-isob-east-1 with FIPS enabled and DualStack disabled + func testResolve18() throws { + let endpointParams = EndpointParams( + region: "us-isob-east-1", + useDualStack: false, + useFIPS: true + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging-fips.us-isob-east-1.sc2s.sgov.gov", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For region us-isob-east-1 with FIPS disabled and DualStack enabled + func testResolve19() throws { + let endpointParams = EndpointParams( + region: "us-isob-east-1", + useDualStack: true, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + XCTAssertThrowsError(try resolver.resolve(params: endpointParams)) { error in + switch error { + case ClientRuntime.EndpointError.unresolved(let message): + XCTAssertEqual("DualStack is enabled but this partition does not support DualStack", message) + default: + XCTFail() + } + } + } + + /// For region us-isob-east-1 with FIPS disabled and DualStack disabled + func testResolve20() throws { + let endpointParams = EndpointParams( + region: "us-isob-east-1", + useDualStack: false, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://social-messaging.us-isob-east-1.sc2s.sgov.gov", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For custom endpoint with region set and fips disabled and dualstack disabled + func testResolve21() throws { + let endpointParams = EndpointParams( + endpoint: "https://example.com", + region: "us-east-1", + useDualStack: false, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://example.com", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For custom endpoint with region not set and fips disabled and dualstack disabled + func testResolve22() throws { + let endpointParams = EndpointParams( + endpoint: "https://example.com", + useDualStack: false, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + let actual = try resolver.resolve(params: endpointParams) + + let properties: [String: AnyHashable] = + [:] + + let headers = SmithyHTTPAPI.Headers() + let expected = try SmithyHTTPAPI.Endpoint(urlString: "https://example.com", headers: headers, properties: properties) + + XCTAssertEqual(expected, actual) + } + + /// For custom endpoint with fips enabled and dualstack disabled + func testResolve23() throws { + let endpointParams = EndpointParams( + endpoint: "https://example.com", + region: "us-east-1", + useDualStack: false, + useFIPS: true + ) + let resolver = try DefaultEndpointResolver() + + XCTAssertThrowsError(try resolver.resolve(params: endpointParams)) { error in + switch error { + case ClientRuntime.EndpointError.unresolved(let message): + XCTAssertEqual("Invalid Configuration: FIPS and custom endpoint are not supported", message) + default: + XCTFail() + } + } + } + + /// For custom endpoint with fips disabled and dualstack enabled + func testResolve24() throws { + let endpointParams = EndpointParams( + endpoint: "https://example.com", + region: "us-east-1", + useDualStack: true, + useFIPS: false + ) + let resolver = try DefaultEndpointResolver() + + XCTAssertThrowsError(try resolver.resolve(params: endpointParams)) { error in + switch error { + case ClientRuntime.EndpointError.unresolved(let message): + XCTAssertEqual("Invalid Configuration: Dualstack and custom endpoint are not supported", message) + default: + XCTFail() + } + } + } + + /// Missing region + func testResolve25() throws { + let endpointParams = EndpointParams( + ) + let resolver = try DefaultEndpointResolver() + + XCTAssertThrowsError(try resolver.resolve(params: endpointParams)) { error in + switch error { + case ClientRuntime.EndpointError.unresolved(let message): + XCTAssertEqual("Invalid Configuration: Missing Region", message) + default: + XCTFail() + } + } + } + +} diff --git a/packageDependencies.plist b/packageDependencies.plist index c2736237ae9..9fffb700c6e 100644 --- a/packageDependencies.plist +++ b/packageDependencies.plist @@ -9,6 +9,6 @@ clientRuntimeBranch main clientRuntimeVersion - 0.77.0 + 0.78.0