in aws-codeartifact-repository/src/main/java/software/amazon/codeartifact/repository/ReadHandler.java [42:71]
private ProgressEvent<ResourceModel, CallbackContext> listTags(
AmazonWebServicesClientProxy proxy,
ProgressEvent<ResourceModel, CallbackContext> progress,
ResourceHandlerRequest<ResourceModel> request,
ProxyClient<CodeartifactClient> proxyClient
) {
return proxy.initiate("AWS-CodeArtifact-Repository::ListTags", proxyClient, progress.getResourceModel(), progress.getCallbackContext())
.translateToServiceRequest(Translator::translateToListTagsRequest)
.makeServiceCall((awsRequest, client) -> {
logger.log(String.format("%s ListTags is being invoked", ResourceModel.TYPE_NAME));
ListTagsForResourceResponse listTagsResponse = null;
try {
listTagsResponse = client.injectCredentialsAndInvokeV2(awsRequest, proxyClient.client()::listTagsForResource);
} catch (final AwsServiceException e) {
String domainName = request.getDesiredResourceState().getDomainName();
Translator.throwCfnException(e, Constants.LIST_TAGS_FOR_RESOURCE, domainName);
}
logger.log(String.format("Tags of %s has successfully been read.", ResourceModel.TYPE_NAME));
return listTagsResponse;
})
.done((ListTagsForResourceRequest, listTagsResponse, proxyInvocation, resourceModel, context) -> {
if (listTagsResponse != null) {
List<Tag> tags = listTagsResponse.tags();
resourceModel.setTags(Translator.fromListTagsResponse(tags));
}
return ProgressEvent.progress(resourceModel, context);
});
}