createConnector method

Future<CreateConnectorResponse> createConnector({
  1. required Capacity capacity,
  2. required Map<String, String> connectorConfiguration,
  3. required String connectorName,
  4. required KafkaCluster kafkaCluster,
  5. required KafkaClusterClientAuthentication kafkaClusterClientAuthentication,
  6. required KafkaClusterEncryptionInTransit kafkaClusterEncryptionInTransit,
  7. required String kafkaConnectVersion,
  8. required List<Plugin> plugins,
  9. required String serviceExecutionRoleArn,
  10. String? connectorDescription,
  11. LogDelivery? logDelivery,
  12. NetworkType? networkType,
  13. Map<String, String>? tags,
  14. WorkerConfiguration? workerConfiguration,
})

Creates a connector using the specified properties.

May throw BadRequestException. May throw ConflictException. May throw ForbiddenException. May throw InternalServerErrorException. May throw NotFoundException. May throw ServiceUnavailableException. May throw TooManyRequestsException. May throw UnauthorizedException.

Parameter capacity : Information about the capacity allocated to the connector. Exactly one of the two properties must be specified.

Parameter connectorConfiguration : A map of keys to values that represent the configuration for the connector.

Parameter connectorName : The name of the connector.

Parameter kafkaCluster : Specifies which Apache Kafka cluster to connect to.

Parameter kafkaClusterClientAuthentication : Details of the client authentication used by the Apache Kafka cluster.

Parameter kafkaClusterEncryptionInTransit : Details of encryption in transit to the Apache Kafka cluster.

Parameter kafkaConnectVersion : The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.

Parameter plugins : Specifies which plugin to use for the connector. You must specify a single-element list containing one customPlugin object.

Parameter serviceExecutionRoleArn : The Amazon Resource Name (ARN) of the IAM role used by the connector to access the Amazon Web Services resources that it needs. The types of resources depends on the logic of the connector. For example, a connector that has Amazon S3 as a destination must have permissions that allow it to write to the S3 destination bucket.

Parameter connectorDescription : A summary description of the connector.

Parameter logDelivery : Details about log delivery.

Parameter networkType : The network type of the connector. It gives connectors connectivity to either IPv4 (IPV4) or IPv4 and IPv6 (DUAL) destinations. Defaults to IPV4.

Parameter tags : The tags you want to attach to the connector.

Parameter workerConfiguration : Specifies which worker configuration to use with the connector.

Implementation

Future<CreateConnectorResponse> createConnector({
  required Capacity capacity,
  required Map<String, String> connectorConfiguration,
  required String connectorName,
  required KafkaCluster kafkaCluster,
  required KafkaClusterClientAuthentication kafkaClusterClientAuthentication,
  required KafkaClusterEncryptionInTransit kafkaClusterEncryptionInTransit,
  required String kafkaConnectVersion,
  required List<Plugin> plugins,
  required String serviceExecutionRoleArn,
  String? connectorDescription,
  LogDelivery? logDelivery,
  NetworkType? networkType,
  Map<String, String>? tags,
  WorkerConfiguration? workerConfiguration,
}) async {
  final $payload = <String, dynamic>{
    'capacity': capacity,
    'connectorConfiguration': connectorConfiguration,
    'connectorName': connectorName,
    'kafkaCluster': kafkaCluster,
    'kafkaClusterClientAuthentication': kafkaClusterClientAuthentication,
    'kafkaClusterEncryptionInTransit': kafkaClusterEncryptionInTransit,
    'kafkaConnectVersion': kafkaConnectVersion,
    'plugins': plugins,
    'serviceExecutionRoleArn': serviceExecutionRoleArn,
    if (connectorDescription != null)
      'connectorDescription': connectorDescription,
    if (logDelivery != null) 'logDelivery': logDelivery,
    if (networkType != null) 'networkType': networkType.value,
    if (tags != null) 'tags': tags,
    if (workerConfiguration != null)
      'workerConfiguration': workerConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/connectors',
    exceptionFnMap: _exceptionFns,
  );
  return CreateConnectorResponse.fromJson(response);
}