createIntegration method

Future<Integration> createIntegration({
  1. required String integrationName,
  2. required String sourceArn,
  3. required String targetArn,
  4. Map<String, String>? additionalEncryptionContext,
  5. String? description,
  6. String? kMSKeyId,
  7. List<Tag>? tagList,
})

Creates a zero-ETL integration or S3 event integration with Amazon Redshift.

May throw IntegrationAlreadyExistsFault. May throw IntegrationConflictOperationFault. May throw IntegrationQuotaExceededFault. May throw IntegrationSourceNotFoundFault. May throw IntegrationTargetNotFoundFault. May throw InvalidClusterStateFault. May throw InvalidTagFault. May throw TagLimitExceededFault. May throw UnsupportedOperationFault.

Parameter integrationName : The name of the integration.

Parameter sourceArn : The Amazon Resource Name (ARN) of the database to use as the source for replication.

Parameter targetArn : The Amazon Resource Name (ARN) of the Amazon Redshift data warehouse to use as the target for replication.

Parameter additionalEncryptionContext : An optional set of non-secret key–value pairs that contains additional contextual information about the data. For more information, see Encryption context in the Amazon Web Services Key Management Service Developer Guide.

You can only include this parameter if you specify the KMSKeyId parameter.

Parameter description : A description of the integration.

Parameter kMSKeyId : An Key Management Service (KMS) key identifier for the key to use to encrypt the integration. If you don't specify an encryption key, the default Amazon Web Services owned key is used.

Parameter tagList : A list of tags.

Implementation

Future<Integration> createIntegration({
  required String integrationName,
  required String sourceArn,
  required String targetArn,
  Map<String, String>? additionalEncryptionContext,
  String? description,
  String? kMSKeyId,
  List<Tag>? tagList,
}) async {
  final $request = <String, String>{
    'IntegrationName': integrationName,
    'SourceArn': sourceArn,
    'TargetArn': targetArn,
    if (additionalEncryptionContext != null)
      for (var e1 in additionalEncryptionContext.entries
          .toList()
          .asMap()
          .entries) ...{
        'AdditionalEncryptionContext.entry.${e1.key + 1}.key': e1.value.key,
        'AdditionalEncryptionContext.entry.${e1.key + 1}.value':
            e1.value.value,
      },
    if (description != null) 'Description': description,
    if (kMSKeyId != null) 'KMSKeyId': kMSKeyId,
    if (tagList != null)
      if (tagList.isEmpty)
        'TagList': ''
      else
        for (var i1 = 0; i1 < tagList.length; i1++)
          for (var e3 in tagList[i1].toQueryMap().entries)
            'TagList.Tag.${i1 + 1}.${e3.key}': e3.value,
  };
  final $result = await _protocol.send(
    $request,
    action: 'CreateIntegration',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'CreateIntegrationResult',
  );
  return Integration.fromXml($result);
}