createConnection method
Creates a connection that can then be given to other Amazon Web Services services like CodePipeline so that it can access third-party code repositories. The connection is in pending status until the third-party connection handshake is completed from the console.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ResourceUnavailableException.
Parameter connectionName :
The name of the connection to be created.
Parameter hostArn :
The Amazon Resource Name (ARN) of the host associated with the connection
to be created.
Parameter providerType :
The name of the external provider where your third-party code repository
is configured.
Parameter tags :
The key-value pair to use when tagging the resource.
Implementation
Future<CreateConnectionOutput> createConnection({
required String connectionName,
String? hostArn,
ProviderType? providerType,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'CodeStar_connections_20191201.CreateConnection'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ConnectionName': connectionName,
if (hostArn != null) 'HostArn': hostArn,
if (providerType != null) 'ProviderType': providerType.value,
if (tags != null) 'Tags': tags,
},
);
return CreateConnectionOutput.fromJson(jsonResponse.body);
}