getConnection method

Future<GetConnectionOutput> getConnection({
  1. required String connectionArn,
})

Returns the connection ARN and details such as status, owner, and provider type.

May throw ResourceNotFoundException. May throw ResourceUnavailableException.

Parameter connectionArn : The Amazon Resource Name (ARN) of a connection.

Implementation

Future<GetConnectionOutput> getConnection({
  required String connectionArn,
}) async {
  ArgumentError.checkNotNull(connectionArn, 'connectionArn');
  _s.validateStringLength(
    'connectionArn',
    connectionArn,
    0,
    256,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target':
        'com.amazonaws.codestar.connections.CodeStar_connections_20191201.GetConnection'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ConnectionArn': connectionArn,
    },
  );

  return GetConnectionOutput.fromJson(jsonResponse.body);
}