in aws-connect-userhierarchygroup/src/main/java/software/amazon/connect/userhierarchygroup/UpdateHandler.java [37:58]
private ProgressEvent<ResourceModel, CallbackContext> updateUserHierarchyGroupName(final AmazonWebServicesClientProxy proxy,
final ProxyClient<ConnectClient> proxyClient,
final ResourceModel desiredStateModel,
final ResourceModel previousStateModel,
final ProgressEvent<ResourceModel, CallbackContext> progress,
final CallbackContext context,
final Logger logger) {
final boolean updateUserHierarchyGroupName = !StringUtils.equals(desiredStateModel.getName(), previousStateModel.getName());
if (updateUserHierarchyGroupName) {
logger.log(String.format("Calling UpdateUserHierarchyGroupName API for UserHierarchyGroup:%s", desiredStateModel.getUserHierarchyGroupArn()));
return proxy.initiate("connect::updateUserHierarchyGroupName", proxyClient, desiredStateModel, context)
.translateToServiceRequest(UpdateHandler::translateToUpdateUserHierarchyGroupNameRequest)
.makeServiceCall((req, clientProxy) -> invoke(req, clientProxy, clientProxy.client()::updateUserHierarchyGroupName, logger))
.progress();
} else {
logger.log(String.format("UserHierarchyGroup name field is unchanged from in the update operation, " +
"skipping UpdateUserHierarchyGroupName API call for UserHierarchyGroup:%s", desiredStateModel.getUserHierarchyGroupArn()));
return progress;
}
}