associateExternalConnection method
Adds an existing external connection to a repository. One external connection is allowed per repository.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter domain :
The name of the domain that contains the repository.
Parameter externalConnection :
The name of the external connection to add to the repository. The
following values are supported:
-
public:npmjs- for the npm public repository. -
public:nuget-org- for the NuGet Gallery. -
public:pypi- for the Python Package Index. -
public:maven-central- for Maven Central. -
public:maven-googleandroid- for the Google Android repository. -
public:maven-gradleplugins- for the Gradle plugins repository. -
public:maven-commonsware- for the CommonsWare Android repository. -
public:maven-clojars- for the Clojars repository. -
public:ruby-gems-org- for RubyGems.org. -
public:crates-io- for Crates.io.
Parameter repository :
The name of the repository to which the external connection is added.
Parameter domainOwner :
The 12-digit account number of the Amazon Web Services account that owns
the domain. It does not include dashes or spaces.
Implementation
Future<AssociateExternalConnectionResult> associateExternalConnection({
required String domain,
required String externalConnection,
required String repository,
String? domainOwner,
}) async {
final $query = <String, List<String>>{
'domain': [domain],
'external-connection': [externalConnection],
'repository': [repository],
if (domainOwner != null) 'domain-owner': [domainOwner],
};
final response = await _protocol.send(
payload: null,
method: 'POST',
requestUri: '/v1/repository/external-connection',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return AssociateExternalConnectionResult.fromJson(response);
}