createConnection method

Future<CreateConnectionOutput> createConnection({
  1. required String domainIdentifier,
  2. required String name,
  3. AwsLocation? awsLocation,
  4. String? clientToken,
  5. List<Configuration>? configurations,
  6. String? description,
  7. bool? enableTrustedIdentityPropagation,
  8. String? environmentIdentifier,
  9. ConnectionPropertiesInput? props,
  10. ConnectionScope? scope,
})

Creates a new connection. In Amazon DataZone, a connection enables you to connect your resources (domains, projects, and environments) to external resources and services.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter domainIdentifier : The ID of the domain where the connection is created.

Parameter name : The connection name.

Parameter awsLocation : The location where the connection is created.

Parameter clientToken : A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.

Parameter configurations : The configurations of the connection.

Parameter description : A connection description.

Parameter enableTrustedIdentityPropagation : Specifies whether the trusted identity propagation is enabled.

Parameter environmentIdentifier : The ID of the environment where the connection is created.

Parameter props : The connection props.

Parameter scope : The scope of the connection.

Implementation

Future<CreateConnectionOutput> createConnection({
  required String domainIdentifier,
  required String name,
  AwsLocation? awsLocation,
  String? clientToken,
  List<Configuration>? configurations,
  String? description,
  bool? enableTrustedIdentityPropagation,
  String? environmentIdentifier,
  ConnectionPropertiesInput? props,
  ConnectionScope? scope,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    if (awsLocation != null) 'awsLocation': awsLocation,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (configurations != null) 'configurations': configurations,
    if (description != null) 'description': description,
    if (enableTrustedIdentityPropagation != null)
      'enableTrustedIdentityPropagation': enableTrustedIdentityPropagation,
    if (environmentIdentifier != null)
      'environmentIdentifier': environmentIdentifier,
    if (props != null) 'props': props,
    if (scope != null) 'scope': scope.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/connections',
    exceptionFnMap: _exceptionFns,
  );
  return CreateConnectionOutput.fromJson(response);
}