updateRepository method

Future<UpdateRepositoryResult> updateRepository({
  1. required String domain,
  2. required String repository,
  3. String? description,
  4. String? domainOwner,
  5. List<UpstreamRepository>? upstreams,
})

Update the properties of a 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 associated with the repository to update.

Parameter repository : The name of the repository to update.

Parameter description : An updated repository description.

Parameter domainOwner : The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.

Parameter upstreams : A list of upstream repositories to associate with the repository. The order of the upstream repositories in the list determines their priority order when CodeArtifact looks for a requested package version. For more information, see Working with upstream repositories.

Implementation

Future<UpdateRepositoryResult> updateRepository({
  required String domain,
  required String repository,
  String? description,
  String? domainOwner,
  List<UpstreamRepository>? upstreams,
}) async {
  final $query = <String, List<String>>{
    'domain': [domain],
    'repository': [repository],
    if (domainOwner != null) 'domain-owner': [domainOwner],
  };
  final $payload = <String, dynamic>{
    if (description != null) 'description': description,
    if (upstreams != null) 'upstreams': upstreams,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/v1/repository',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return UpdateRepositoryResult.fromJson(response);
}