aws-memorydb-cluster/src/main/java/software/amazon/memorydb/cluster/UpdateHandler.java [187:209]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private ProgressEvent<ResourceModel, CallbackContext> tagResource(final AmazonWebServicesClientProxy proxy,
                                                                      final ProxyClient<MemoryDbClient> proxyClient,
                                                                      final ResourceModel model,
                                                                      final CallbackContext callbackContext,
                                                                      final Map<String, String> tags) {
        final String arn = model.getARN();
        final Set<Tag> currentTags = mapToTags(tags);
        final Set<Tag> existingTags = listTags(proxy, proxyClient, model, callbackContext);
        final Set<Tag> tagsToRemove = Sets.difference(existingTags, currentTags);
        final Set<Tag> tagsToAdd = Sets.difference(currentTags, existingTags);

        if (CollectionUtils.isNotEmpty(tagsToRemove)) {
            UntagResourceResponse untagResourceResponse = proxy.injectCredentialsAndInvokeV2(Translator.translateToUntagResourceRequest(arn, tagsToRemove), proxyClient.client()::untagResource);
            model.setTags(translateTagsFromSdk(untagResourceResponse.tagList()));
        }

        if (CollectionUtils.isNotEmpty(tagsToAdd)) {
            TagResourceResponse tagResourceResponse = proxy.injectCredentialsAndInvokeV2(Translator.translateToTagResourceRequest(arn, tagsToAdd), proxyClient.client()::tagResource);
            model.setTags(translateTagsFromSdk(tagResourceResponse.tagList()));
        }

        return ProgressEvent.progress(model, callbackContext);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-memorydb-parametergroup/src/main/java/software/amazon/memorydb/parametergroup/UpdateHandler.java [79:101]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private ProgressEvent<ResourceModel, CallbackContext> tagResource(final AmazonWebServicesClientProxy proxy,
                                                                      final ProxyClient<MemoryDbClient> proxyClient,
                                                                      final ResourceModel model,
                                                                      final CallbackContext callbackContext,
                                                                      final Map<String, String> tags) {
        final String arn = model.getARN();
        final Set<Tag> currentTags = mapToTags(tags);
        final Set<Tag> existingTags = listTags(proxy, proxyClient, model, callbackContext);
        final Set<Tag> tagsToRemove = Sets.difference(existingTags, currentTags);
        final Set<Tag> tagsToAdd = Sets.difference(currentTags, existingTags);

        if (CollectionUtils.isNotEmpty(tagsToRemove)) {
            UntagResourceResponse untagResourceResponse = proxy.injectCredentialsAndInvokeV2(Translator.translateToUntagResourceRequest(arn, tagsToRemove), proxyClient.client()::untagResource);
            model.setTags(translateTagsFromSdk(untagResourceResponse.tagList()));
        }

        if (CollectionUtils.isNotEmpty(tagsToAdd)) {
            TagResourceResponse tagResourceResponse = proxy.injectCredentialsAndInvokeV2(Translator.translateToTagResourceRequest(arn, tagsToAdd), proxyClient.client()::tagResource);
            model.setTags(translateTagsFromSdk(tagResourceResponse.tagList()));
        }

        return ProgressEvent.progress(model, callbackContext);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-memorydb-subnetgroup/src/main/java/software/amazon/memorydb/subnetgroup/UpdateHandler.java [100:122]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private ProgressEvent<ResourceModel, CallbackContext> tagResource(final AmazonWebServicesClientProxy proxy,
                                                                      final ProxyClient<MemoryDbClient> proxyClient,
                                                                      final ResourceModel model,
                                                                      final CallbackContext callbackContext,
                                                                      final Map<String, String> tags) {
        final String arn = model.getARN();
        final Set<Tag> currentTags = mapToTags(tags);
        final Set<Tag> existingTags = listTags(proxy, proxyClient, model, callbackContext);
        final Set<Tag> tagsToRemove = Sets.difference(existingTags, currentTags);
        final Set<Tag> tagsToAdd = Sets.difference(currentTags, existingTags);

        if (CollectionUtils.isNotEmpty(tagsToRemove)) {
            UntagResourceResponse untagResourceResponse = proxy.injectCredentialsAndInvokeV2(Translator.translateToUntagResourceRequest(arn, tagsToRemove), proxyClient.client()::untagResource);
            model.setTags(translateTagsFromSdk(untagResourceResponse.tagList()));
        }

        if (CollectionUtils.isNotEmpty(tagsToAdd)) {
            TagResourceResponse tagResourceResponse = proxy.injectCredentialsAndInvokeV2(Translator.translateToTagResourceRequest(arn, tagsToAdd), proxyClient.client()::tagResource);
            model.setTags(translateTagsFromSdk(tagResourceResponse.tagList()));
        }

        return ProgressEvent.progress(model, callbackContext);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



